Page 5 of 35 FirstFirst ... 3456715 ... LastLast
Results 61 to 75 of 517

Thread: XPath Modding Explanation Thread

  1. #61
    Colony Founder JaxTeller718's Avatar
    Join Date
    Aug 2015
    Location
    Ravenhearst
    Posts
    4,358
    Rep Power
    1
    Quote Originally Posted by CyrusBlaze View Post
    (Have not tested this yet - will attempt to do so when I get home tonight)

    How about adding/changing things within the text files such as the locilization.txt?
    I do not want to take anything away from this wonderful addition so first let me say thank you for putting the time and effort into making this happen.

    That said I cant stress enough the importance of the Localization being something we have control over using xpath. Unfortunately I can not use xpath as I wished i could have due to this. So many of my mods include new items and blocks and require descriptions that by having to still do them by hand in the original file, as well as having to instruct people HOW to copy the Localization into their vanilla install negates the use of this for me and some others.

    Also the issue will arise where someone like myself and others include vanilla Localizations in their modlets, and each will contain DIFFERENT entries that when the user copies into their files will overwrite the other. I know this may not seem like a priority but descriptions and conformity in naming conventions almost require we be able to include our own Localization in mods.

  2. #62
    Colony Founder JaxTeller718's Avatar
    Join Date
    Aug 2015
    Location
    Ravenhearst
    Posts
    4,358
    Rep Power
    1
    I dont know if I found a bug or not but I was messing around with combinations of modlets and Ravenhearst. It seems that if I add a block with a custom asset into the xml, and then add a modlet that also has a custom block it OVERWRITE the Ravenhearst one.

    For example I have a drying rack in Ravenhearst. I added it to 17 using the old method. I then went to drop my farming modlet in that adds wheat. My drying racks disappeared and became a wheat plant.

    Mentioning this because for mods like Walkers and Darkness Falls that have complete overhauls this could cause massive issues if players install modlets on top of it and it removes our items. Was this intentional?

    If it is I think it should be explicitly stated that this is how it works otherwise somewhere along the line someone is going to install something from the Launcher and then try to add modlets and its going to wreck their games.

  3. #63
    Colony Founder sphereii's Avatar
    Join Date
    Dec 2015
    Posts
    3,670
    Rep Power
    1
    Quote Originally Posted by JaxTeller718 View Post
    I dont know if I found a bug or not but I was messing around with combinations of modlets and Ravenhearst. It seems that if I add a block with a custom asset into the xml, and then add a modlet that also has a custom block it OVERWRITE the Ravenhearst one.

    For example I have a drying rack in Ravenhearst. I added it to 17 using the old method. I then went to drop my farming modlet in that adds wheat. My drying racks disappeared and became a wheat plant.

    Mentioning this because for mods like Walkers and Darkness Falls that have complete overhauls this could cause massive issues if players install modlets on top of it and it removes our items. Was this intentional?

    If it is I think it should be explicitly stated that this is how it works otherwise somewhere along the line someone is going to install something from the Launcher and then try to add modlets and its going to wreck their games.
    That isn't the expected results. Can you send me the files through discord, and I'll take a look? Are you using <append> or <insertBefore> and <insertAfter> ?

    - - - Updated - - -

    Quote Originally Posted by JaxTeller718 View Post
    I do not want to take anything away from this wonderful addition so first let me say thank you for putting the time and effort into making this happen.

    That said I cant stress enough the importance of the Localization being something we have control over using xpath. Unfortunately I can not use xpath as I wished i could have due to this. So many of my mods include new items and blocks and require descriptions that by having to still do them by hand in the original file, as well as having to instruct people HOW to copy the Localization into their vanilla install negates the use of this for me and some others.

    Also the issue will arise where someone like myself and others include vanilla Localizations in their modlets, and each will contain DIFFERENT entries that when the user copies into their files will overwrite the other. I know this may not seem like a priority but descriptions and conformity in naming conventions almost require we be able to include our own Localization in mods.
    The testing version of SDX has removed the ability to merge the xpath, but it kept the ability to apply localization.

    If your SDX mod folder is like this:

    Code:
    JaxTeller718/Config/
    JaxTeller718/Scripts/
    JaxTeller718/Text/
    JaxTeller718/Resources/
    It will copy the Config and Resource scripts over into the Game's Mods/JaxTeller718/ as-is, build and apply the scripts, and do the localization merge.

    It's definitely not ideal, and I believe there's plans to include native support for localization, but we just aren't there yet.

  4. #64
    Refugee
    Join Date
    Nov 2016
    Posts
    7
    Rep Power
    0
    Hi!

    Can you send me an example of ModInfo.xml file please ?

  5. #65
    Colony Founder sphereii's Avatar
    Join Date
    Dec 2015
    Posts
    3,670
    Rep Power
    1
    Quote Originally Posted by LightNox View Post
    Hi!

    Can you send me an example of ModInfo.xml file please ?
    Sure

    Code:
    <?xml version="1.0" encoding="UTF-8" ?>
    <xml>
    	<ModInfo>
    		<Name value="SphereII_PG13" />
    		<Description value="This modlet tries to make the game a bit more PG, by switching out the stripper model with a nurse." />
    		<Author value="sphereii" />
    		<Version value="1.0.0" />
    	</ModInfo>
    </xml>

  6. #66
    Reconstructionist CyrusBlaze's Avatar
    Join Date
    Feb 2015
    Posts
    502
    Rep Power
    1
    Quote Originally Posted by JaxTeller718 View Post
    That said I cant stress enough the importance of the Localization being something we have control over using xpath. Unfortunately I can not use xpath as I wished i could have due to this. So many of my mods include new items and blocks and require descriptions that by having to still do them by hand in the original file, as well as having to instruct people HOW to copy the Localization into their vanilla install negates the use of this for me and some others.

    While you may not be able to modify the locilization file. I have had decent success in modifying a description directly and bypassing the localization file (if it cant fidn it in the locilization fiel it prints it as is ingame)


    It may not be perfect for all cases, but my limited use of it works well enough until propr localization modding is implemented.

  7. #67
    Refugee
    Join Date
    Nov 2016
    Posts
    7
    Rep Power
    0
    I try to build my first mod on A17.

    But can i add a picture on toolbelt for change the Xui with xpath ?
    Last edited by LightNox; 11-22-2018 at 12:52 PM.

  8. #68
    Guppycurian Forum Whore Guppycur's Avatar
    Join Date
    Apr 2014
    Location
    Enemy for life
    Posts
    21,966
    Rep Power
    1
    You people are welcome to join my Discord, a lot of my guys have a good grasp of XPath and are willing to help via live chat.

    https://discord.gg/8yGBq9e

  9. #69
    Colony Founder KhaineGB's Avatar
    Join Date
    Apr 2017
    Location
    Liverpool, UK
    Posts
    1,847
    Rep Power
    1
    Don't ask me. I suck at xpath

  10. #70
    Inventor wolverine576's Avatar
    Join Date
    Dec 2015
    Posts
    914
    Rep Power
    0
    This is AWESOME! Will make the adding of tweaks and personal changes so much easier!

    now to learn it haha

    Ok how do i add in new Item? I want to create the herbal bandage. Using Chrysanthemum and goldenrod, and NitratePowder. I want to make a first aid bandage that works like vanilla, but half strength.

  11. #71
    Refugee
    Join Date
    Dec 2017
    Location
    Germany
    Posts
    20
    Rep Power
    0
    Playing around with it a bit, really like it.
    I hope we get more functions, like 'mult', 'add', 'sub'.

    For now I will use stacksize selectors:
    Code:
    <configs>
    
      <set xpath="/items/item[contains(@name,'resource')]/property[
                    @name='Stacknumber'
                    and @value > 900
                  ]/@value">20000</set>
    
      <set xpath="/items/item[contains(@name,'resource')]/property[
                    @name='Stacknumber'
                    and @value <= 900
                    and @value > 400
                  ]/@value">2000</set>
    
      <set xpath="/items/item[contains(@name,'resource')]/property[
                    @name='Stacknumber'
                    and @value <= 400
                    and @value > 100
                  ]/@value">1000</set>
    
      <set xpath="/items/item[contains(@name,'resource')]/property[
                    @name='Stacknumber'
                    and @value < 100
                  ]/@value">250</set>
    
    </configs>

  12. #72
    Inventor wolverine576's Avatar
    Join Date
    Dec 2015
    Posts
    914
    Rep Power
    0
    Quote Originally Posted by Alloc View Post
    For your generic XML issues I recommend using e.g. Notepad++ with the XML plugin. It will tell you when the general XML structure is borked (like if you forget to close an XML element, mismatching open and close names etc).
    Can you link to the plugin?

  13. #73
    Colony Founder sphereii's Avatar
    Join Date
    Dec 2015
    Posts
    3,670
    Rep Power
    1
    Quote Originally Posted by wolverine576 View Post
    Can you link to the plugin?
    If you use the 32-bit version of NotePad++, go to Plugins -> Plugin Manager. Do any update it asks for. Then search in the available list for XML Tools.

    I'm not sure if the 64-bit version of Notepad++ has the Plugin Manager working yet; it may need manual downloads and file placements.

  14. #74
    Inventor wolverine576's Avatar
    Join Date
    Dec 2015
    Posts
    914
    Rep Power
    0
    Attempting to Add in Valmars Fuel log, requires adding in a new recipe and Item. Heres what i did....

    2 files in config folder
    recipes has

    Code:
    <configs>
    	    <append xpath="/recipes">
    	
                    <recipe name="fuelLog" count="1">
    	                  <ingredient name="resourceWood" count="20"/>
    	                  <ingredient name="resourceTallow" count="1" />
                    </recipe>
    
    		</append>
    </configs>
    And Items has

    Code:
    <configs>
    	    <append xpath="/items">
    	
                	<item name="fuelLog">
    
    	                   <property name="Meshfile" value="Items/Misc/sackPrefab"/>
    	                   <property name="DropMeshfile" value="Items/Misc/sack_droppedPrefab"/>
        	               <property name="Material" value="Mwood"/>
    	                   <property name="HoldType" value="45"/>
    					   <property name="DescriptionKey" value="fuelLogDesc"/>
    		               <property name="Stacknumber" value="50" />
    					   	<property name="Weight" value="5"/>
        	               <property name="SellableToTrader" value="true"/>
    		               <property name="EconomicValue" value="34"/>
    		               <property name="FuelValue" value="580" />
    	                   <property name="Group" value="Resources,Basics"/>
    	                   <property name="CraftingSkillGroup" value="craftSkillScience"/>
    					   <property name="CraftingIngredientTime" value="0.25"/>
    		        
    				 
    	             </item>
    	
    		</append>
    </configs>
    Hows it look?

    Holy crap it worked lol I had to edit the main localization file right? no way yet to use xpath to edit those yet?
    Last edited by wolverine576; 11-23-2018 at 03:30 AM.

  15. #75
    Guppycurian Forum Whore Guppycur's Avatar
    Join Date
    Apr 2014
    Location
    Enemy for life
    Posts
    21,966
    Rep Power
    1
    Khaine did a recipe one, if you need a sample...

    https://7daystodie.com/forums/showth...958#post877958

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •