Page 2 of 3 FirstFirst 123 LastLast
Results 16 to 30 of 32

Thread: Video Tutorial : XPath Modding in A17 for Beginners.

  1. #16
    Survivor Winterhart's Avatar
    Join Date
    Dec 2015
    Posts
    69
    Rep Power
    0
    I don't know what I'm doing wrong.

    I want to change all zombie sounds to this new one. The growling noises give me nightmares so I currently don't play with zombies on.

    I get this message when loading:

    WRN xml patch for "sounds.xml" from mod "ChangeZombieSounds" did not apply
    <set xpath="/sounds/SoundDataNode[@name='zombieArlene']/AudioSource[@name='Sounds/AudioSource']"

    The zombie I am working with is now silent and I get a message every time the zombie would be making a sound:

    AudioManager::AudioData::Play() failed to load audio clip #@modfolder(ChangeZombieSounds):resources/ChangeSounds.unity3d?ZombieSounds

    In unity Parent object is ChangeSounds, child object is ZombieSounds and has ZombieSounds.wav attached to it. That was built into ChangeSounds.unity3d and is in my resources folder.

    Now for the code:
    sounds.xml

    <append xpath="/Sounds">
    <SoundDataNode name="ZombieSounds">
    <AudioSource name="Sounds/AudioSource_Pain"/>
    <Noise ID="1" range="1" volume="7" time="3" muffled_when_crouched="0.5"/>
    <AudioClip ClipName="#@modfolder:resources/ChangeSounds.unity3d?ZombieSounds"/>
    <Channel name="Mouth"/>
    <Priority name="2"/>
    <maxVoicesPerEntity value="1"/>
    <LocalCrouchVolumeScale value="1.0"/>
    <CrouchNoiseScale value="0.5"/>
    <NoiseScale value="1"/>
    <MaxVoices value="10"/>
    <MaxRepeatRate value="0.9"/>
    </SoundDataNode>
    </append>

    <set xpath="/sounds/SoundDataNode[@name='zombieArlene']/AudioSource[@name='Sounds/AudioSource']">ZombieSounds</set>

    ----------------------------------------------------------------------------------------------------------------------------

    entityclasses.xml

    <set xpath="/entity_classes/entity_class[@name='zombieArlene']/property[@name='SoundRandom' and @value='Enemies/Base_Zombie_Female/zombiefemaleroam']/@value">ZombieSounds</set>

    <set xpath="/entity_classes/entity_class[@name='zombieArlene']/property[@name='SoundAlert' and @value='Enemies/Base_Zombie_Female/zombiefemalealert']/@value">ZombieSounds</set>

    <set xpath="/entity_classes/entity_class[@name='zombieArlene']/property[@name='SoundAttack' and @value='Enemies/Base_Zombie_Female/zombiefemaleattack']/@value">ZombieSounds</set>

    <set xpath="/entity_classes/entity_class[@name='zombieArlene']/property[@name='SoundHurt' and @value='Enemies/Base_Zombie_Female/zombiefemalepain']/@value">ZombieSounds</set>

    <set xpath="/entity_classes/entity_class[@name='zombieArlene']/property[@name='SoundDeath' and @value='Enemies/Base_Zombie_Female/zombiefemaledeath']/@value">ZombieSounds</set>

    <set xpath="/entity_classes/entity_class[@name='zombieArlene']/property[@name='SoundSense' and @value='Enemies/Base_Zombie_Female/zombiefemalesense']/@value">ZombieSounds</set>
    Last edited by Winterhart; 03-03-2019 at 01:58 AM. Reason: rewrite post

  2. #17
    Survivor Winterhart's Avatar
    Join Date
    Dec 2015
    Posts
    69
    Rep Power
    0
    Quote Originally Posted by Winterhart View Post
    I don't know what I'm doing wrong.
    I want to change all zombie sounds to this new one. The growling noises give me nightmares so I currently don't play with zombies on.
    Need help with blanket settings.

    Got it working for zombies on an individual basis with this:

    <set xpath="/entity_classes/entity_class[@name='zombieArlene']/property[@name='SoundRandom' and @value='Enemies/Base_Zombie_Female/zombiefemaleroam']/@value">ZombieSounds</set>

    <set xpath="/entity_classes/entity_class[@name='zombieArlene']/property[@name='SoundAlert' and @value='Enemies/Base_Zombie_Female/zombiefemalealert']/@value">ZombieSounds</set>

    <set xpath="/entity_classes/entity_class[@name='zombieArlene']/property[@name='SoundAttack' and @value='Enemies/Base_Zombie_Female/zombiefemaleattack']/@value">ZombieSounds</set>

    <set xpath="/entity_classes/entity_class[@name='zombieArlene']/property[@name='SoundHurt' and @value='Enemies/Base_Zombie_Female/zombiefemalepain']/@value">ZombieSounds</set>

    <set xpath="/entity_classes/entity_class[@name='zombieArlene']/property[@name='SoundDeath' and @value='Enemies/Base_Zombie_Female/zombiefemaledeath']/@value">ZombieSounds</set>

    <set xpath="/entity_classes/entity_class[@name='zombieArlene']/property[@name='SoundSense' and @value='Enemies/Base_Zombie_Female/zombiefemalesense']/@value">ZombieSounds</set>

    What I want to do is a blanket setting for anything containing zombie and sound to set to my ZombieSounds. Is that even possible.

    I tried blanket setting with this for one of the sounds:

    <set xpath="/entity_classes/entity_class[[email protected],'zombie']/property[@name='SoundRandom']/@value">ZombieSounds</set>


    I don't get any errors when loading or warning while running, but it doesn't do anything. If I try to add the same format for the other sounds I get an error message.

  3. #18
    Hunter
    Join Date
    Jul 2015
    Posts
    140
    Rep Power
    0
    Code:
    <set xpath="/entity_classes/entity_class[contains(@name,'zombie')]/property[@name='SoundRandom']/@value">ZombieSounds</set>

  4. #19
    Survivor Winterhart's Avatar
    Join Date
    Dec 2015
    Posts
    69
    Rep Power
    0
    Quote Originally Posted by DukeW74 View Post
    Code:
    <set xpath="/entity_classes/entity_class[contains(@name,'zombie')]/property[@name='SoundRandom']/@value">ZombieSounds</set>
    Thank you, but it still doesn't do anything. currentconfigs shows nothing changed.

  5. #20
    Ranger Quantum Blue's Avatar
    Join Date
    Apr 2017
    Location
    Michigan USA
    Posts
    256
    Rep Power
    1
    Quote Originally Posted by Winterhart View Post
    Thank you, but it still doesn't do anything. currentconfigs shows nothing changed.
    Hey Winter, kind of learning XPath myself. I did find a way to change ALL ZOMBIE SOUNDS to a value:

    <set xpath="/entity_classes/entity_class[contains(@name,'zombie')]/property[contains(@name,'Sound')]/@value">Enemies/Base_Zombie_Male/zombiemalealert</set>

    ExportCurrentConfigs shows all Zombie Sounds modified.

    I used the default base male zombie just to test with (and to avoid any possible errors with a new sound). You can replace with your "ZombieSounds".
    It does generate 3 errors: ZombieBoe, zombiedogs and something else. I figured this at least gets you going.

    Hope it helps.

  6. #21
    Colony Founder SlicksGirl's Avatar
    Join Date
    Apr 2016
    Location
    Texas, pre-apoloclypse
    Posts
    1,312
    Rep Power
    1

    extra content at end of line 7

    thanks, i think i am doing this right. I made admin tools and then an admin starter kit. I think i appended this to the entity classes right but notepadd++ keeps saying the middle xpath has extra content at the end of line 7.


    Code:
    <?xml version="1.0" encoding="UTF-8"?>
    
    <DWModsAdminMod>
    
    <set xpath="/entity_classes/entity_class/[@name="playerMale"]/property[@name="ItemsOnEnterGame.GameModeSurvival" ]/@valueadminsuperbag</set>
    <set xpath="/entity_classes/entity_class/[@name="playerMale"]/property[@name="ItemsOnEnterGame.GameModeSurvivalSP" ]/@valueadminsuperbag</set>
    <set xpath="/entity_classes/entity_class/[@name="playerMale"]/property[@name="ItemsOnEnterGame.GameModeSurvivalMP" ]/@valueadminsuperbag</set>
    
    </DWModsAdminMod>

    ooh i fixed it, i used double quote where i should have used single.

    Code:
    <DWModsAdminMod>
    
    <set xpath="/entity_classes/entity_class[@name='playerMale']/property[@name='ItemsOnEnterGame.GameModeSurvival']/@value">adminsuperbag</set>
    <set xpath="/entity_classes/entity_class[@name='playerMale']/property[@name='ItemsOnEnterGame.GameModeSurvivalSP']/@value">adminsuperbag</set>
    <set xpath="/entity_classes/entity_class[@name='playerMale']/property[@name='ItemsOnEnterGame.GameModeSurvivalMP']/@value">adminsuperbag</set>
    
    </DWModsAdminMod>

    thank you so very much for your video
    Last edited by SlicksGirl; 03-19-2019 at 03:04 PM.

  7. #22
    Colony Founder SlicksGirl's Avatar
    Join Date
    Apr 2016
    Location
    Texas, pre-apoloclypse
    Posts
    1,312
    Rep Power
    1
    so i've run into a snag with running <append xpath=/lootcontainer>

    it is not recognizing items in the loot list, even vanilla items copied over exactly from the vanilla files.

    i'm trying to make this starter bag by Valmod https://7daystodie.com/forums/showth...t=starter+pack and everything else loads and parses perfectly, except the loot in the lootlists on the lootcontainer page.

    any Ideas?


    Code:
    <?xml version="1.0" encoding="UTF-8"?>
    
    <DWModsAdminMod>
    
    <append xpath="/lootcontainers">
    
    
    <!--small Loot-->
    
    <lootgroup name="adminCoin" count="all">
         <item group="meleeBoneShiv" count="4"/>
        <item group="modArmorTripleStoragePocket" count="4"/>
        <item group="cntSecureStorageChest" count="4"/>	
    </lootgroup>
    its saying the boneshive doesnt exist. i swapped out casinocoins for a boneshive in case my admin coins that extended the casino coins were the issue.

    thanks for your help
    Last edited by SlicksGirl; 03-19-2019 at 06:09 PM.

  8. #23
    Hunter
    Join Date
    Jul 2015
    Posts
    140
    Rep Power
    0
    Do you have an item group named meleeBoneShiv ?


    I am assuming you want


    Code:
    <lootgroup name="adminCoin" count="all">
        <item name="meleeBoneShiv" count="4"/>
        <item name="modArmorTripleStoragePocket" count="4"/>
        <item name="cntSecureStorageChest" count="4"/>    
    </lootgroup>

  9. #24
    Colony Founder SlicksGirl's Avatar
    Join Date
    Apr 2016
    Location
    Texas, pre-apoloclypse
    Posts
    1,312
    Rep Power
    1
    Quote Originally Posted by DukeW74 View Post
    Do you have an item group named meleeBoneShiv ?


    I am assuming you want


    Code:
    <lootgroup name="adminCoin" count="all">
        <item name="meleeBoneShiv" count="4"/>
        <item name="modArmorTripleStoragePocket" count="4"/>
        <item name="cntSecureStorageChest" count="4"/>    
    </lootgroup>
    i fixed that error several hour ago. Thanks!

    though its still bugged, cant get it to spawn the loot when i break the first container. and most container models completely break the game when used. but I've been up doing coding and manual labor for 24 hours straight now. So i'll try to tackle the refusal to spawn loot issue tomorrow.

  10. #25
    Hunter
    Join Date
    Jul 2015
    Posts
    140
    Rep Power
    0
    May I suggest you get this mod and make it do what you want. Most of the legwork is already done for you, unless you are just trying to learn.

    Here


    I think it is a good practice when working with loot to use insertAfter and Before. loot can be tricky sometimes.

    This will insert after the last vanilla group and then after the last vanilla container, I used "249". I think 250 is max
    Code:
    <configs>
    <insertAfter xpath="/lootcontainers/lootgroup[@name='BuriedStashChest']">
    <lootgroup name="adminCoin" count="all">
        <item name="meleeBoneShiv" count="4"/>
        <item name="modArmorTripleStoragePocket" count="4"/>
        <item name="cntSecureStorageChest" count="4"/>  
    </lootgroup>
    </insertAfter>
    
    
    <insertAfter xpath="/lootcontainers/lootcontainer[@id='116']">
    
    
    <lootcontainer id="249" count="1" size="8,9" sound_open="UseActions/open_cardboard" sound_close="UseActions/close_cardboard" loot_quality_template="treasureTemplate" destroy_on_close="true">
    	<item group="adminCoin"/>
    </lootcontainer>
    </insertAfter>
    </configs>

  11. #26
    Colony Founder SlicksGirl's Avatar
    Join Date
    Apr 2016
    Location
    Texas, pre-apoloclypse
    Posts
    1,312
    Rep Power
    1
    Quote Originally Posted by DukeW74 View Post
    May I suggest you get this mod and make it do what you want. Most of the legwork is already done for you, unless you are just trying to learn.

    Here


    I think it is a good practice when working with loot to use insertAfter and Before. loot can be tricky sometimes.

    This will insert after the last vanilla group and then after the last vanilla container, I used "249". I think 250 is max
    Code:
    <configs>
    <insertAfter xpath="/lootcontainers/lootgroup[@name='BuriedStashChest']">
    <lootgroup name="adminCoin" count="all">
        <item name="meleeBoneShiv" count="4"/>
        <item name="modArmorTripleStoragePocket" count="4"/>
        <item name="cntSecureStorageChest" count="4"/>  
    </lootgroup>
    </insertAfter>
    
    
    <insertAfter xpath="/lootcontainers/lootcontainer[@id='116']">
    
    
    <lootcontainer id="249" count="1" size="8,9" sound_open="UseActions/open_cardboard" sound_close="UseActions/close_cardboard" loot_quality_template="treasureTemplate" destroy_on_close="true">
    	<item group="adminCoin"/>
    </lootcontainer>
    </insertAfter>
    </configs>
    thank you for upselling your mods.

    I've made this mod before, multiple times, and i havnt had this issue since the first time i made it. I dont remember how i fixed it then.

    I've been modding for over 3 years now, not an expert like some other fantastic people here but, 1. I need more coding experience in gaming. 2. I want stuff on my server to be coded by me. 3. I want everything on my server to be exclusive. 4. I want to make sure the modlets I make are compatible with each other and if I build this overhaul out of modlets I know how to not create redundancies and conflicts. I've spent a week dividing up my planned 20 mods into non-conflicting modlets prior to coding them. and Ive put close to 24 hours into coding this single modlet because I pay attention to detail. lastly, this modlet is a template for 3 other similar mods for my server.
    Last edited by SlicksGirl; 03-21-2019 at 10:51 AM.

  12. #27
    Guppycurian Forum Whore Guppycur's Avatar
    Join Date
    Apr 2014
    Location
    Enemy for life
    Posts
    21,333
    Rep Power
    1
    I don't think he was upselling his mod at all (especially since it wasn't his mod), I think his advice is sound.

    You can have all the experience in the world, but he's right... looking at other people's work is by far the best way to learn.

  13. #28
    Colony Founder SlicksGirl's Avatar
    Join Date
    Apr 2016
    Location
    Texas, pre-apoloclypse
    Posts
    1,312
    Rep Power
    1
    I'm a big fan of yours and Valmods work and spend quite a bit of time referencing your code. Still rather write my own, at least for the experience and to make sure its doing what i want it to do. as i've said before, I've written this piece before. it worked beautifully. Then my teenage stepson got angry we said no and snuck into my office one night and deleted a ♥♥♥♥ ton of stuff off my computer, my 7dtd folder of mods being one of those things, among many programs and games. most of it was super easy to redownload, my modding folder wasnt so much.
    Last edited by SlicksGirl; 03-21-2019 at 05:47 PM.

  14. #29
    Guppycurian Forum Whore Guppycur's Avatar
    Join Date
    Apr 2014
    Location
    Enemy for life
    Posts
    21,333
    Rep Power
    1
    You haven't murdered him yet?

  15. #30
    Colony Founder SlicksGirl's Avatar
    Join Date
    Apr 2016
    Location
    Texas, pre-apoloclypse
    Posts
    1,312
    Rep Power
    1
    Quote Originally Posted by Guppycur View Post
    You haven't murdered him yet?
    i figure he will get there all on his own.. lol

Posting Permissions

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