Page 34 of 35 FirstFirst ... 2432333435 LastLast
Results 496 to 510 of 512

Thread: XPath Modding Explanation Thread

  1. #496
    Survivor
    Join Date
    Jul 2019
    Location
    USA
    Posts
    67
    Rep Power
    0
    Alright, quick question for you... I'm trying to adjust a particular block in the blocks.xml. The line I have is

    Code:
    <drop event="Harvest" name="resourceWood" count="500" tag="oreWoodHarvest"/>
    I'm attempting to change the "500" part of the above code. What I attempted was:

    Code:
    <set xpath="/blocks/block[@name='woodLogPillar100']/property[@name='drop']@count">600</set>
    I know the code is wrong but I can't find any information on how to point to the "count" field inside the (drop event="Harvest") line?

    I want to change an existing harvest amount to be different in case the above jumble made no sense. For my future reference I would like to change the (name) field as well? Maybe it is simpler than I think. Any ideas?
    Last edited by Belgeranrg; 4 Weeks Ago at 10:14 PM.

  2. #497
    Colony Founder sphereii's Avatar
    Join Date
    Dec 2015
    Posts
    3,665
    Rep Power
    1
    Quote Originally Posted by Belgeranrg View Post
    Alright, quick question for you... I'm trying to adjust a particular block in the blocks.xml. The line I have is

    Code:
    <drop event="Harvest" name="resourceWood" count="500" tag="oreWoodHarvest"/>
    I'm attempting to change the "54000" part of the above code. What I attempted was:

    Code:
    <set xpath="/blocks/block[@name='woodLogPillar100']/property[@name='drop']@count">600</set>
    I know the code is wrong but I can't find any information on how to point to the "count" field inside the (drop event="Harvest") line?

    I want to change an existing harvest amount to be different in case the above jumble made no sense. For my future reference I would like to change the (name) field as well? Maybe it is simpler than I think. Any ideas?
    Try this:

    Code:
    <set xpath="/blocks/block[@name='woodLogPillar100']/drop[@name='resourceWood']/@count">600</set>
    You wouldn't use property here, since <property does not exist on the line.

  3. #498
    Survivor
    Join Date
    Jul 2019
    Location
    USA
    Posts
    67
    Rep Power
    0
    Quote Originally Posted by sphereii View Post
    Try this:

    Code:
    <set xpath="/blocks/block[@name='woodLogPillar100']/drop[@name='resourceWood']/@count">600</set>
    You wouldn't use property here, since <property does not exist on the line.
    Okay after you pointed out my very obvious retardation I tried this:

    Code:
    <set xpath="/blocks/block[@name='woodLogPillar100']/drop_event[@name='Harvest']@count">60000</set>
    I also tried
    Code:
    <set xpath="/blocks/block[@name='woodLogPillar100']/drop[@event='Harvest']@count">60000</set>
    Still no dice. I've tried variations of dropEvent, drop, drop_Event, and drop event but it still errors out. I would like to make sure that my change ONLY affects the <drop event="Harvest" name="resourceWood" count="???"> area...

  4. #499
    Survivor
    Join Date
    Jul 2019
    Location
    USA
    Posts
    67
    Rep Power
    0
    Quote Originally Posted by sphereii View Post
    Try this:

    Code:
    <set xpath="/blocks/block[@name='woodLogPillar100']/drop[@name='resourceWood']/@count">600</set>
    You wouldn't use property here, since <property does not exist on the line.
    Okay after you pointed out my very obvious retardation I tried this:

    Code:
    <set xpath="/blocks/block[@name='woodLogPillar100']/drop_event[@name='Harvest']@count">60000</set>
    I also tried
    Code:
    <set xpath="/blocks/block[@name='woodLogPillar100']/drop[@event='Harvest']@count">60000</set>
    Still no dice. I've tried variations of dropEvent, drop, drop_Event, and drop event but it still errors out. I would like to make sure that my change ONLY affects the <drop event="Harvest" name="resourceWood" count="???"> area...

    The code you provided gives me a syntax error.

  5. #500
    Colony Founder sphereii's Avatar
    Join Date
    Dec 2015
    Posts
    3,665
    Rep Power
    1
    Quote Originally Posted by Belgeranrg View Post
    Okay after you pointed out my very obvious retardation I tried this:

    Code:
    <set xpath="/blocks/block[@name='woodLogPillar100']/drop_event[@name='Harvest']@count">60000</set>
    I also tried
    Code:
    <set xpath="/blocks/block[@name='woodLogPillar100']/drop[@event='Harvest']@count">60000</set>
    Still no dice. I've tried variations of dropEvent, drop, drop_Event, and drop event but it still errors out. I would like to make sure that my change ONLY affects the <drop event="Harvest" name="resourceWood" count="???"> area...

    The code you provided gives me a syntax error.
    I think my example still works. In both of your other iterations, you forgot to put in a forward slash in front of the @ /@count

  6. #501
    Survivor
    Join Date
    Jul 2019
    Location
    USA
    Posts
    67
    Rep Power
    0
    Perfect, that is what I was missing in this case. However, some blocks have drop event="destroy", some have drop event="disassemble", and some have the drop event="Harvest" any ideas how I would point out those paths?

  7. #502
    Colony Founder sphereii's Avatar
    Join Date
    Dec 2015
    Posts
    3,665
    Rep Power
    1
    Quote Originally Posted by Belgeranrg View Post
    Perfect, that is what I was missing in this case. However, some blocks have drop event="destroy", some have drop event="disassemble", and some have the drop event="Harvest" any ideas how I would point out those paths?
    You can do multi-conditionals

    Code:
    <set xpath="/blocks/block[@name='woodLogPillar100']/drop[@name='resourceWood' and @event='Harvest']/@count">600</set>

  8. #503
    Survivor
    Join Date
    Jul 2019
    Location
    USA
    Posts
    67
    Rep Power
    0
    I always forget booleans. I'm not too great with this programming thing yet. You've been a lifesaver.

  9. #504
    Colony Founder sphereii's Avatar
    Join Date
    Dec 2015
    Posts
    3,665
    Rep Power
    1
    Quote Originally Posted by Belgeranrg View Post
    I always forget booleans. I'm not too great with this programming thing yet. You've been a lifesaver.
    No problem. Good luck!

  10. #505
    Refugee
    Join Date
    Jul 2019
    Posts
    2
    Rep Power
    0
    Could you please help me with something, I'm new to this modding and I have been trying to make a mod which makes the Iron Hoe faster but I keep getting syntax error

    Code:
    <set xpath="/items/item[@name='meleeToolHoeIron']/property[@class='Action1']/property[@name'Delay']/@value">0.05
    <set>

    EDIT:After reading a few post before, I manage to find out where I was wrong , but thanks anyway for making this modding tutorial
    Last edited by PasiRin; 4 Weeks Ago at 06:17 AM.

  11. #506
    Colony Founder sphereii's Avatar
    Join Date
    Dec 2015
    Posts
    3,665
    Rep Power
    1
    Quote Originally Posted by PasiRin View Post
    Could you please help me with something, I'm new to this modding and I have been trying to make a mod which makes the Iron Hoe faster but I keep getting syntax error

    Code:
    <set xpath="/items/item[@name='meleeToolHoeIron']/property[@class='Action1']/property[@name'Delay']/@value">0.05
    <set>

    EDIT:After reading a few post before, I manage to find out where I was wrong , but thanks anyway for making this modding tutorial
    Glad you were able to figure it out.

  12. #507
    Colony Founder Lonestarcanuck's Avatar
    Join Date
    May 2014
    Location
    Texas
    Posts
    1,934
    Rep Power
    1
    so I created a modlet and have a new item I appended to items.xml. I want to create an icon for it.

    1. is there an icon tutorial? like size, file type, location it goes, etc.

    2. will a player need to install anything or can I just put the mod and icon on the server?

  13. #508
    Ranger bdubyah's Avatar
    Join Date
    Dec 2016
    Location
    Tennessee
    Posts
    338
    Rep Power
    1
    Quote Originally Posted by Lonestarcanuck View Post
    so I created a modlet and have a new item I appended to items.xml. I want to create an icon for it.

    1. is there an icon tutorial? like size, file type, location it goes, etc.

    2. will a player need to install anything or can I just put the mod and icon on the server?
    Icon size right now is 116x80. I *think* the A18 HD ones are 116x116, could be wrong. Create a folder in your mod folder called ItemIcons. Place them in there. I know png and jpg work for sure. Maybe others.

    Any mod that contains anything more than just xmls has to be installed on the server and client both. Resources, icons, localization will not push from the server.

  14. #509
    Refugee
    Join Date
    Aug 2019
    Posts
    1
    Rep Power
    0
    hello everyone,

    i tried to create a modlet which went good so far but i want to add another tag at the progression xml.

    For example at the perk living of the land i want to add the tag chocolateseeds but i got no idea how to write that down. Do I have to use append, set or setattribute for this to work? And how does the line actually look if its done right.

    I tried a lot but coudnt figure out right typing.

  15. #510
    Reconstructionist layarion's Avatar
    Join Date
    Jun 2015
    Location
    U.S.A. East Coast
    Posts
    551
    Rep Power
    0
    ...i need to remove these T5 quest from vanilla quests.xml: https://i.imgur.com/cSOOrT2.png

    Code:
        <quest_list id="trader_quests">
            <!-- Tier 1 -->
                <quest id="tier1_clear" />
                <quest id="tier1_fetch" />
                <quest id="tier1_buried_supplies" />
            <!-- Tier 2 -->
                <quest id="tier2_clear" />
                <quest id="tier2_fetch" />
                <quest id="tier2_hidden_cache" />
                <quest id="tier2_fetch_clear" />
            <!-- Tier 3 -->
                <quest id="tier3_clear" />
                <quest id="tier3_fetch" />
                <quest id="tier3_hidden_cache" />
                <quest id="tier3_fetch_clear" />
                <quest id="tier3_hidden_clear" />
            <!-- Tier 4 -->
                <quest id="tier4_clear" />
                <quest id="tier4_fetch" />
                <quest id="tier4_hidden_cache" />
                <quest id="tier4_fetch_clear" />
                <quest id="tier4_hidden_clear" />    
            <!-- Tier 5 -->
                <quest id="tier5_clear" />
                <quest id="tier5_fetch" />
                <quest id="tier5_hidden_cache" />
                <quest id="tier5_fetch_clear" />
                <quest id="tier5_hidden_clear" />
            <!-- Tier 6 -->
                <!--    <quest id="tier6_clear" /> -->
                <!--    <quest id="tier6_fetch" /> -->
                <!--    <quest id="tier6_hidden_cache" /> -->
                <!--    <quest id="tier6_fetch_clear" /> -->
                <!--    <quest id="tier6_hidden_clear" /> -->
        </quest_list>
    This is what i got, but doubt it's right, and i can't test it right now:
    Code:
    <configs>
        <remove xpath="/quests/quest_list[@id='trader_quests']//quest[@id='tier5_clear']"/>
        <remove xpath="/quests/quest_list[@id='trader_quests']//quest[@id='tier5_fetch']"/>
        <remove xpath="/quests/quest_list[@id='trader_quests']//quest[@id='tier5_hidden_cache']"/>
        <remove xpath="/quests/quest_list[@id='trader_quests']//quest[@id='tier5_fetch_clear']"/>
        <remove xpath="/quests/quest_list[@id='trader_quests']//quest[@id='tier5_hidden_clear']"/>
    </configs>
    this is to bypass a game-breaking bug found here: https://7daystodie.com/forums/showth...FoundException
    Last edited by layarion; 1 Week Ago at 11:26 PM.

Posting Permissions

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