Results 1 to 4 of 4

Thread: Code for biomes.xml modlet correct?

  1. #1
    Tracker Cernwn's Avatar
    Join Date
    Oct 2016
    Location
    Hell, Oregon, United States
    Posts
    169
    Rep Power
    1

    Code for biomes.xml modlet correct?

    Code:
    <theMist>
    	<!-- Strip existing code -->
    	<remove xpath="/worldgeneration/biomes/biome/weather/Fog">
    
            <!-- Add 100% chance of 50m fog to valid biomes, in order to help performance via occlusion -->
    	<insertAfter="/worldgeneration/biomes/biome[@name='snow' or 'pine_forest' or 'desert' or 'radiated' or 'wasteland' or 'burnt_forest' or 'city' or 'city_wasteland' or 'wasteland_hub']/weather/Temperature">
    		<append xpath="/worldgeneration/biomes/biome/weather">
    			<Fog min="0" max="0" prob="0"/>
    			<Fog min="50" max="50" prob="1"/>
    		</append>
    	</insertAfter>
    </theMist>

  2. #2
    Hunter psouza4's Avatar
    Join Date
    Dec 2014
    Location
    Meridian, Idaho, USA
    Posts
    102
    Rep Power
    0
    Close, but some minor syntax issues here.

    Your <remove> tag is missing an end tag: it should be closed with />. You can't use an <append> inside of an <insertAfter>, just use the <insertAfter>. Also incorrect is your logic for the or condition, which should be referencing each variable for each part of the condition. Finally, <insertAfter> requires an xpath, it's a syntax error to assign the opening tag to what you want the xpath to be.

    I believe this is what you're trying to do:

    /Config/biomes.xml
    Code:
    <theMist>
    	<!-- Strip existing code -->
    	<remove xpath="/worldgeneration/biomes/biome/weather/Fog"/>
    
    	<!-- Add 100% chance of 50m fog to valid biomes, in order to help performance via occlusion -->
    	<insertAfter xpath="/worldgeneration/biomes/biome[@name='snow' or @name='pine_forest' or @name='desert' or @name='radiated' or @name='wasteland' or @name='burnt_forest' or @name='city' or @name='city_wasteland' or @name='wasteland_hub']/weather/Temperature">
    		<Fog min="0" max="0" prob="0"/>
    		<Fog min="50" max="50" prob="1"/>
    	</insertAfter>
    </theMist>
    This code removes all of the overall rules for creating Fog and inserts a 50%-strength Fog (probability 100%) to the following biomes: snow, pine_forest, desert, radiated, wasteland, burnt_forest, city, city_wasteland, and wasteland_hub.
    Last edited by psouza4; 3 Weeks Ago at 05:51 PM.

  3. #3
    Tracker Cernwn's Avatar
    Join Date
    Oct 2016
    Location
    Hell, Oregon, United States
    Posts
    169
    Rep Power
    1
    @psouza4/MeanCloud:
    Fog values must be hardcoded or something, since changing these values directly in the XML(not via modlet) did absolutely nothing. AFAIK admins can still change weather via console commands, but that is only temporary. Regardless, thank you VERY much for this attempt.
    Last edited by Cernwn; 2 Weeks Ago at 01:01 AM.

  4. #4
    Hunter psouza4's Avatar
    Join Date
    Dec 2014
    Location
    Meridian, Idaho, USA
    Posts
    102
    Rep Power
    0
    Quote Originally Posted by Cernwn View Post
    @psouza4/MeanCloud:
    Thank you VERY much for your help with this XML.
    Glad it worked for you

Posting Permissions

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