Jump to content

XPath Modding Explanation Thread


sphereii

Recommended Posts

29 minutes ago, Ricowan said:

It looks like you're trying to add your new lootgroups to an element named "loot", but that doesn't exist in the loot.xml file.  The root node in that file is "lootcontainers".

What happens if you change <append xpath="/loot"> to <append xpath="/lootcontainers"> ?

I'll give that a try when I get home.  Thanks for the idea.  Will let you know how it pans out.

 

Link to comment
Share on other sites

Update, changing the root node did fix it, partially.  Now I get an error stating that there are multiple instances of groupApparelFaceCover.  Just to see if that was going to be the only issue, I commented that block of code out, and it gave the same error, except now it said sportingGoods.  I checked through the loot.xml file for the Vanilla game, and there are exactly two groupApparelFaceCover, one that defines <lootgroup name="groupApparelFaceCover"> and one that adds that loot group to <lootgroup name="groupApparelClothes">.  It is a similar situation with <lootgroup name="sportingGoods">, there is the block that defines the lootgroup, then there is another block where the lootgroup is added to a loot container.

Vanilla loot.xml references:

<lootgroup name="groupApparelFaceCover"> Defines the loot group on line 1307

<lootgroup name="groupApparelFaceCover"> Added to loot group on line 1337

<lootgroup name="sportingGoods">  Defines the loot group on line 2868

<lootgroup name="sportingGoods">  Added to loot container on line 3845

 

Again, I am trying to get my new item to drop in the same loot containers that would drop the other glasses in the game.  All of the other glasses are part of three loot groups.  <lootgroup name="groupApparelFaceCover">  ,   <lootgroup name="sportGoods">  and  <lootgroup name="clothingTestLoot">

I'm at a loss right now and I assume that without getting this code to work, the only way I will ever see my new shades in the game is by using Creative Mode to get them.  I'm sure I am missing something, but I have no idea what it could be.

Link to comment
Share on other sites

OK, so if the lootgroup elements already exist, then you only need to append your new item to those existing elements:

 

<append xpath="/lootcontainers/lootgroup[@name='groupApparelFaceCover']">
    <item name="apparelSuperShades" mods="dye" mod_chance="0"/>        <!-- Add Super Shades to groupApparelFaceCover lootgroup -->
</append>
 

etc.

 

Link to comment
Share on other sites

1 hour ago, Ricowan said:

OK, so if the lootgroup elements already exist, then you only need to append your new item to those existing elements:

 

<append xpath="/lootcontainers/lootgroup[@name='groupApparelFaceCover']">
    <item name="apparelSuperShades" mods="dye" mod_chance="0"/>        <!-- Add Super Shades to groupApparelFaceCover lootgroup -->
</append>
 

etc.

 

That worked!  Thank you Ricowan for your help.  Now the new shades are in the game, they "should" drop in game, I still need to verify that but that could take a while.  Now it's just a matter of getting the stats to show up on the shades in game.  The stats are applied to the shades just fine, they just are not listed on the display when you look at the shades in game.

 

Link to comment
Share on other sites

Just figured I would pop back into the thread to let you guys know, I got the display properties working for my new shades!  It doesn't list all the stats, but it shows me the important ones so I can tell which pair will be better.  The only thing left to confirm is that they are dropping in game.  Since I fixed the issues with that block of code I haven't really seen many glasses drop, maybe 2 or 3 total, so we're still testing that.

On a side note, anyone have any ideas how I can maybe use creative to spawn in a loot container that has a chance of dropping eyewear?  Or know a way that I can maybe force them to spawn so I can verify that they drop?

Link to comment
Share on other sites

Can anyone point me to information about making changes to vanilla Localization in my mod? All I can find is info on adding new items. I made a mod to change crafting perks and I want to modify the Localization in my mod to reflect the changes, but what I have does not change anything.

 Example of the header and one line that I am currently hacking at trying.

 

key,source,context,changes,english,
perkLightArmorRank1LongDesc,progression,perk Agi,"You have started on the path of the lightly armored warrior. Craft quality 3 fair light armor, reduce light armor movement penalty by 15% and stamina penalty by 10%. Improve durability by 50%.\nUnlocks leather armor crafting.",

Link to comment
Share on other sites

16 hours ago, Quicksilver said:

Can anyone point me to information about making changes to vanilla Localization in my mod? All I can find is info on adding new items. I made a mod to change crafting perks and I want to modify the Localization in my mod to reflect the changes, but what I have does not change anything.

 Example of the header and one line that I am currently hacking at trying.

 

key,source,context,changes,english,
perkLightArmorRank1LongDesc,progression,perk Agi,"You have started on the path of the lightly armored warrior. Craft quality 3 fair light armor, reduce light armor movement penalty by 15% and stamina penalty by 10%. Improve durability by 50%.\nUnlocks leather armor crafting.",

You can just write
key,english

Edited by CrazyAluminum (see edit history)
Link to comment
Share on other sites

Is it possible to change

<property name="RepairTools" value="resourceRepairKit"/>

with one line to 

<property name="RepairTools" value="gunMGT1AK47Parts"/>

if

<property name="Material" value="MMachineGunParts"/>

?

Also, how to create multiple not(contains ) in one line?

<item name="gunMGT1AK47">
	<property name="Tags" value="weapon,ranged,holdBreathAiming,reloadPenalty,gun,barrelAttachments,sideAttachments,smallTopAttachments,mediumTopAttachments,stock,magazine,drumMagazine,firingMode,bottomAttachments,attFortitude,perkMachineGunner,perkBookAutoWeapons,canHaveCosmetic"/>
	<property name="DisplayType" value="rangedGun"/>
	<property name="HoldType" value="48"/>
	<property name="Meshfile" value="#Other/Items?Weapons/Ranged/ak47/ak47Prefab.prefab"/>
	<property name="Material" value="MMachineGunParts"/> <property name="Weight" value="4"/>

	<property name="CrosshairOnAim" value="true"/> <!-- aimTest -->
	<property name="CrosshairUpAfterShot" value="true"/> <!-- aimTest -->

	<property name="RepairTools" value="resourceRepairKit"/>
	<property name="DegradationBreaksAfter" value="false"/>

	<property name="SoundJammed" value="weapon_jam"/>
	<property name="Sound_Sight_In" value="rifle_sight_in"/>
	<property name="Sound_Sight_Out" value="rifle_sight_out"/>

	<property name="RepairExpMultiplier" value="10.8"/>
	<property name="EconomicValue" value="500"/>
	<property name="UnlockedBy" value="perkMachineGunner,gunMGT1AK47Schematic"/>
	<property name="ShowQuality" value="true"/>
	<property name="Group" value="Ammo/Weapons"/>

	<property class="Action0">
		<property name="Class" value="Ranged"/>
		<property name="Delay" value=".150"/> <!-- obsolete if rounds per minute exists -->
		<property name="Magazine_items" value="ammo762mmBulletBall,ammo762mmBulletHP,ammo762mmBulletAP"/>
		<property name="Sound_start" value="ak47_fire"/>
		<property name="Sound_loop" value="ak47_fire"/>
		<property name="Sound_empty" value="dryfire"/>
		<property name="Sound_reload" value="ak47_reload"/>
		<property name="Sound_end" value="ak47_fire_end"/>
		<property name="Particles_muzzle_fire" value="gunfire_AK47"/>
		<property name="Particles_muzzle_fire_fpv" value="gunfire_AK47_fpv"/>
		<requirement name="CVarCompare" cvar="_underwater" operation="LT" value=".98"/>
	</property>
	<property class="Action1">
		<property name="Class" value="Zoom"/>
		<property name="Zoom_max_out" value="55"/>
		<property name="Zoom_max_in" value="55"/>
		<property name="ScopeCameraOffset" value="-.00062,0,.055"/>
	</property>
  ......

 

 

Edited by CrazyAluminum (see edit history)
Link to comment
Share on other sites

8 hours ago, CrazyAluminum said:

Is it possible to change


<property name="RepairTools" value="resourceRepairKit"/>

with one line to 


<property name="RepairTools" value="gunMGT1AK47Parts"/>

Short answer for this is yes.  The code should look something like:
 


<config>
  <set xpath="/items/item[@name='gunMGT1AK47']/property[@name='RepairTools']/@value">gunMGT1AK47Parts</set>
</config>

if


<property name="Material" value="MMachineGunParts"/>

I'm not sure what your goal is with this condition.  But since you provided the block of code that defines the item "gunMGT1AK47" the code I provided to change the item needed to repair it should work.

 

 

 

Link to comment
Share on other sites

1 hour ago, PrimalCarnage said:

 

I meant to change at once every <item /> that contains such Material property inside itself.

So that when adding a mod for a gigantic number of weapons, this all overlaps when it goes next (and it wasn't necessary to add mini-fixes, due to which hundreds of "yellow errors" appear)

Edited by CrazyAluminum (see edit history)
Link to comment
Share on other sites

1 hour ago, CrazyAluminum said:

I meant to change at once every <item /> that contains such Material property inside itself.

So that when adding a mod for a gigantic number of weapons, this all overlaps when it goes next (and it wasn't necessary to add mini-fixes, due to which hundreds of "yellow errors" appear)

Ok, if I understand you correctly, you want to know how to check all items to see if the 'Material' is 'MMachineGunParts', then, if that check is true, change the item needed to repair it from 'RepairTools' to 'gunMGT1AK47Parts'.  Is that correct?

Even if I am not understanding you correctly, I do not know how the xml coding would work for that.  Sorry.  
What I would do as an easy fix, though perhaps not an optimal one, is make sure the code I gave you works for one item.  Then duplicate it for any weapon that you want to use AK47 Parts as the ingredient to repair it.  Again, it may not be the optimal way to do it, but it would at least get it done.

 

Link to comment
Share on other sites

On 10/15/2020 at 9:54 PM, PrimalCarnage said:

Ok, if I understand you correctly, you want to know how to check all items to see if the 'Material' is 'MMachineGunParts', then, if that check is true, change the item needed to repair it from 'RepairTools' to 'gunMGT1AK47Parts'.  Is that correct?

Even if I am not understanding you correctly, I do not know how the xml coding would work for that.  Sorry.  
What I would do as an easy fix, though perhaps not an optimal one, is make sure the code I gave you works for one item.  Then duplicate it for any weapon that you want to use AK47 Parts as the ingredient to repair it.  Again, it may not be the optimal way to do it, but it would at least get it done.

 

I came here precisely to find out whether it can be done or not.

Just example:

<!--rickyalph Guns-->
	<set xpath="/items/item[@name='gunHandgunT1FN57']/property[@name='RepairTools']/@value">gunHandgunT1PistolParts</set>
	<set xpath="/items/item[@name='gunHandgunT1FN57']/effect_group[@name='gunHandgunT1FN57']/passive_effect[@name='DegradationPerUse'][@operation='base_set']/@value">0.4</set>
	<set xpath="/items/item[@name='gunHandgunT2M1911']/property[@name='RepairTools']/@value">gunHandgunT1PistolParts</set>
	<set xpath="/items/item[@name='gunHandgunT2M1911']/effect_group[@name='gunHandgunT2M1911']/passive_effect[@name='DegradationPerUse'][@operation='base_set']/@value">0.4</set>
	<set xpath="/items/item[@name='gunMGT2M4A1']/property[@name='RepairTools']/@value">gunMGT1AK47Parts</set>
	<set xpath="/items/item[@name='gunMGT2M4A1']/effect_group[@name='gunMGT2M4A1']/passive_effect[@name='DegradationPerUse'][@operation='base_set']/@value">0.4</set>
	<set xpath="/items/item[@name='gunRifleT3SCARH']/property[@name='RepairTools']/@value">gunRifleT1HuntingRifleParts</set>
	<set xpath="/items/item[@name='gunRifleT3SCARH']/effect_group[@name='gunRifleT3SCARH']/passive_effect[@name='DegradationPerUse'][@operation='base_set']/@value">0.4</set>

<!--Sykriss VFX-->
	<set xpath="/items/item[@name='gun1911']/property[@name='RepairTools']/@value">gunHandgunT1PistolParts</set>
	<set xpath="/items/item[@name='gun1911']/effect_group[@name='gunPistol']/passive_effect[@name='DegradationPerUse'][@operation='base_set']/@value">0.4</set>
	<set xpath="/items/item[@name='gun45revolver']/property[@name='RepairTools']/@value">gunHandgunT1PistolParts</set>
	<set xpath="/items/item[@name='gun45revolver']/effect_group[@name='gun44Magnum']/passive_effect[@name='DegradationPerUse'][@operation='base_set']/@value">0.4</set>
	<set xpath="/items/item[@name='gun556rifle']/property[@name='RepairTools']/@value">gunRifleT1HuntingRifleParts</set>
	<set xpath="/items/item[@name='gun556rifle']/effect_group[@name='gunHuntingRifle']/passive_effect[@name='DegradationPerUse'][@operation='base_set']/@value">0.4</set>
	<set xpath="/items/item[@name='gun9mmrevolver']/property[@name='RepairTools']/@value">gunHandgunT1PistolParts</set>
	<set xpath="/items/item[@name='gun9mmrevolver']/effect_group[@name='gun44Magnum']/passive_effect[@name='DegradationPerUse'][@operation='base_set']/@value">0.4</set>
	<set xpath="/items/item[@name='gun9mmrifle']/property[@name='RepairTools']/@value">gunRifleT1HuntingRifleParts</set>
	<set xpath="/items/item[@name='gun9mmrifle']/effect_group[@name='gunHuntingRifle']/passive_effect[@name='DegradationPerUse'][@operation='base_set']/@value">0.4</set>
	<set xpath="/items/item[@name='gunGlock17']/property[@name='RepairTools']/@value">gunHandgunT1PistolParts</set>
	<set xpath="/items/item[@name='gunGlock17']/effect_group[@name='gunPistol']/passive_effect[@name='DegradationPerUse'][@operation='base_set']/@value">0.4</set>
	<set xpath="/items/item[@name='gunak101']/property[@name='RepairTools']/@value">gunMGT1AK47Parts</set>
	<set xpath="/items/item[@name='gunak101']/effect_group[@name='gunAK47']/passive_effect[@name='DegradationPerUse'][@operation='base_set']/@value">0.4</set>
	<set xpath="/items/item[@name='gunaks74u']/property[@name='RepairTools']/@value">gunMGT1AK47Parts</set>
	<set xpath="/items/item[@name='gunaks74u']/effect_group[@name='gunAK47']/passive_effect[@name='DegradationPerUse'][@operation='base_set']/@value">0.4</set>
	<set xpath="/items/item[@name='gunar15']/property[@name='RepairTools']/@value">gunRifleT1HuntingRifleParts</set>
	<set xpath="/items/item[@name='gunar15']/effect_group[@name='gunAK47']/passive_effect[@name='DegradationPerUse'][@operation='base_set']/@value">0.4</set>
	<set xpath="/items/item[@name='gundeserteagle']/property[@name='RepairTools']/@value">gunHandgunT1PistolParts</set>
	<set xpath="/items/item[@name='gundeserteagle']/effect_group[@name='gunPistol']/passive_effect[@name='DegradationPerUse'][@operation='base_set']/@value">0.4</set>
	<set xpath="/items/item[@name='gundoublebarrelproper']/property[@name='RepairTools']/@value">gunShotgunT1DoubleBarrelParts</set>
	<set xpath="/items/item[@name='gundoublebarrelproper']/effect_group[@name='gunDoubleBarrelShotgun']/passive_effect[@name='DegradationPerUse'][@operation='base_set']/@value">0.4</set>
	<set xpath="/items/item[@name='gung36c']/property[@name='RepairTools']/@value">gunRifleT1HuntingRifleParts</set>
	<set xpath="/items/item[@name='gung36c']/effect_group[@name='gunAK47']/passive_effect[@name='DegradationPerUse'][@operation='base_set']/@value">0.4</set>
	<set xpath="/items/item[@name='gunhk416']/property[@name='RepairTools']/@value">gunRifleT1HuntingRifleParts</set>
	<set xpath="/items/item[@name='gunhk416']/effect_group[@name='gunAK47']/passive_effect[@name='DegradationPerUse'][@operation='base_set']/@value">0.4</set>
	<set xpath="/items/item[@name='gunm1pcarbine']/property[@name='RepairTools']/@value">gunHandgunT1PistolParts</set>
	<set xpath="/items/item[@name='gunm1pcarbine']/effect_group[@name='gunAK47']/passive_effect[@name='DegradationPerUse'][@operation='base_set']/@value">0.4</set>
	<set xpath="/items/item[@name='gunmac11']/property[@name='RepairTools']/@value">gunHandgunT1PistolParts</set>
	<set xpath="/items/item[@name='gunmac11']/effect_group[@name='gunPistol']/passive_effect[@name='DegradationPerUse'][@operation='base_set']/@value">0.4</set>
	<set xpath="/items/item[@name='gunmakarov']/property[@name='RepairTools']/@value">gunHandgunT1PistolParts</set>
	<set xpath="/items/item[@name='gunmakarov']/effect_group[@name='gunPistol']/passive_effect[@name='DegradationPerUse'][@operation='base_set']/@value">0.4</set>
	<set xpath="/items/item[@name='gunmicrouzi']/property[@name='RepairTools']/@value">gunHandgunT1PistolParts</set>
	<set xpath="/items/item[@name='gunmicrouzi']/effect_group[@name='gunPistol']/passive_effect[@name='DegradationPerUse'][@operation='base_set']/@value">0.4</set>
	<set xpath="/items/item[@name='gunmk23']/property[@name='RepairTools']/@value">gunHandgunT1PistolParts</set>
	<set xpath="/items/item[@name='gunmk23']/effect_group[@name='gunPistol']/passive_effect[@name='DegradationPerUse'][@operation='base_set']/@value">0.4</set>
	<set xpath="/items/item[@name='gunp250']/property[@name='RepairTools']/@value">gunHandgunT1PistolParts</set>
	<set xpath="/items/item[@name='gunp250']/effect_group[@name='gunPistol']/passive_effect[@name='DegradationPerUse'][@operation='base_set']/@value">0.4</set>
	<set xpath="/items/item[@name='gunp99']/property[@name='RepairTools']/@value">gunHandgunT1PistolParts</set>
	<set xpath="/items/item[@name='gunp99']/effect_group[@name='gunPistol']/passive_effect[@name='DegradationPerUse'][@operation='base_set']/@value">0.4</set>
	<set xpath="/items/item[@name='gunpp19']/property[@name='RepairTools']/@value">gunMGT1AK47Parts</set>
	<set xpath="/items/item[@name='gunpp19']/effect_group[@name='gunSMG5']/passive_effect[@name='DegradationPerUse'][@operation='base_set']/@value">0.4</set>
	<set xpath="/items/item[@name='gunrsx1']/property[@name='RepairTools']/@value">gunShotgunT1DoubleBarrelParts</set>
	<set xpath="/items/item[@name='gunrsx1']/effect_group[@name='gunPumpShotgun']/passive_effect[@name='DegradationPerUse'][@operation='base_set']/@value">0.4</set>
	<set xpath="/items/item[@name='gunscarh']/property[@name='RepairTools']/@value">gunMGT1AK47Parts</set>
	<set xpath="/items/item[@name='gunscarh']/effect_group[@name='gunAK47']/passive_effect[@name='DegradationPerUse'][@operation='base_set']/@value">0.4</set>
	<set xpath="/items/item[@name='gunscarl']/property[@name='RepairTools']/@value">gunRifleT1HuntingRifleParts</set>
	<set xpath="/items/item[@name='gunscarl']/effect_group[@name='gunAK47']/passive_effect[@name='DegradationPerUse'][@operation='base_set']/@value">0.4</set>
	<set xpath="/items/item[@name='gunsg553']/property[@name='RepairTools']/@value">gunRifleT1HuntingRifleParts</set>
	<set xpath="/items/item[@name='gunsg553']/effect_group[@name='gunAK47']/passive_effect[@name='DegradationPerUse'][@operation='base_set']/@value">0.4</set>
	<set xpath="/items/item[@name='gunsinglebarrelshotgun']/property[@name='RepairTools']/@value">gunShotgunT1DoubleBarrelParts</set>
	<set xpath="/items/item[@name='gunsinglebarrelshotgun']/effect_group[@name='gunDoubleBarrelShotgun']/passive_effect[@name='DegradationPerUse'][@operation='base_set']/@value">0.4</set>
	<set xpath="/items/item[@name='gunskorpion']/property[@name='RepairTools']/@value">gunHandgunT1PistolParts</set>
	<set xpath="/items/item[@name='gunskorpion']/effect_group[@name='gunPistol']/passive_effect[@name='DegradationPerUse'][@operation='base_set']/@value">0.4</set>
	<set xpath="/items/item[@name='gunsks']/property[@name='RepairTools']/@value">gunMGT1AK47Parts</set>
	<set xpath="/items/item[@name='gunsks']/effect_group[@name='gunAK47']/passive_effect[@name='DegradationPerUse'][@operation='base_set']/@value">0.4</set>
	<set xpath="/items/item[@name='gunsvd']/property[@name='RepairTools']/@value">gunRifleT1HuntingRifleParts</set>
	<set xpath="/items/item[@name='gunsvd']/effect_group[@name='gunAK47']/passive_effect[@name='DegradationPerUse'][@operation='base_set']/@value">0.4</set>
	<set xpath="/items/item[@name='guntec9']/property[@name='RepairTools']/@value">gunHandgunT1PistolParts</set>
	<set xpath="/items/item[@name='guntec9']/effect_group[@name='gunPistol']/passive_effect[@name='DegradationPerUse'][@operation='base_set']/@value">0.4</set>
	<set xpath="/items/item[@name='guntoz34']/property[@name='RepairTools']/@value">gunShotgunT1DoubleBarrelParts</set>
	<set xpath="/items/item[@name='guntoz34']/effect_group[@name='gunDoubleBarrelShotgun']/passive_effect[@name='DegradationPerUse'][@operation='base_set']/@value">0.4</set>
	<set xpath="/items/item[@name='gunump45']/property[@name='RepairTools']/@value">gunHandgunT1PistolParts</set>
	<set xpath="/items/item[@name='gunump45']/effect_group[@name='gunSMG5']/passive_effect[@name='DegradationPerUse'][@operation='base_set']/@value">0.4</set>
	<set xpath="/items/item[@name='gunusp']/property[@name='RepairTools']/@value">gunHandgunT1PistolParts</set>
	<set xpath="/items/item[@name='gunusp']/effect_group[@name='gunPistol']/passive_effect[@name='DegradationPerUse'][@operation='base_set']/@value">0.4</set>

Edited: I understood how. Need to change names to apply something like

<set xpath="//item[contains(@name,'gunHandgunT') or contains(@name,'gunShotgunT') or contains(@name,'gunRifleT') or contains(@name,'gunMGT') and not(contains(@name,'gunShotgunT0'))]/effect_group/passive_effect[@name='DegradationPerUse'][@operation='base_set']/@value">0.4</set>
<set xpath="//item[contains(@name,'gunExplosivesT') or contains(@name,'gunBowT') and not(contains(@name,'gunBowT0'))]/effect_group/passive_effect[@name='DegradationPerUse'][@operation='base_set']/@value">0.4</set>
<set xpath="//item[@name='meleeWpnClubT3SteelClub' or @name='meleeWpnSledgeT3SteelSledgehammer']/effect_group/passive_effect[@name='DegradationPerUse'][@operation='base_set']/@value">0.4</set>
<set xpath="//item[@name='meleeToolPickT3Auger' or @name='meleeToolAxeT3Chainsaw' or @name='meleeToolSalvageT3ImpactDriver']/effect_group/passive_effect[@name='DegradationPerUse'][@operation='base_set']/@value">0.3</set>

 

Edited by CrazyAluminum (see edit history)
Link to comment
Share on other sites

i'm working on a gameplay series that has no traders on the map, but i would still like to do the challenges that i find in loot.

i have tried the following 2 lines of code, and they both do not seem to work
 

<remove xpath="/quests/quest[contains(@id, 'challenge')]/property[@name='completiontype']" />
<remove xpath="/quests/quest[contains(@id, 'challenge')]/objective[@type='InteractWithNPC']" />



using the following challenge as an example:

the property of "completiontype" value= "TurnIn" i was going to use <set xpath> but there is no other completion type for me to set it to. the basic survival quest (which is completed without having to turn in or return to trader) does not have a completion type. does anyone know how i can achieve this?

<quest id="challenge_silenceofthelambs">
        <property name="name_key" value="challenge_silenceofthelambs"/>
        <property name="subtitle_key" value="challenge_silenceofthelambs_subtitle"/>
        <property name="description_key" value="challenge_silenceofthelambs_offer"/>
        <property name="icon" value="ui_game_symbol_zombie"/>
        <property name="repeatable" value="true"/>
        <property name="category_key" value="challenge"/>
        <property name="offer_key" value="challenge_silenceofthelambs_offer"/>
        <property name="difficulty" value="insane"/>
        <property name="completiontype" value="TurnIn"/>

        <objective type="RandomGoto" value="500-800" phase="1">
            <property name="completion_distance" value="50"/>
            <property name="nav_object" value="quest" />
        </objective>

        <objective type="RallyPoint">
            <property name="start_mode" value="Create"/>
            <property name="phase" value="2"/>
            <property name="nav_object" value="rally" />
        </objective>

        <action type="SpawnEnemy" id="zombieScreamer" value="2" phase="3"/>
        <objective type="ZombieKill" id="zombieScreamer" value="2" phase="3"/>

        <objective type="InteractWithNPC">
            <property name="phase" value="4"/>
        </objective>

        <reward type="Exp" value="500"/>
        <!-- You can define a range of rewards like <reward type="Item" id="casinoCoin" value="200-500"/> -->
        <reward type="Item" id="casinoCoin" value="350"/>
    </quest>

 

Link to comment
Share on other sites

7 minutes ago, EpicSpire said:

i'm working on a gameplay series that has no traders on the map, but i would still like to do the challenges that i find in loot.

i have tried the following 2 lines of code, and they both do not seem to work
 


<remove xpath="/quests/quest[contains(@id, 'challenge')]/property[@name='completiontype']" />
<remove xpath="/quests/quest[contains(@id, 'challenge')]/objective[@type='InteractWithNPC']" />



using the following challenge as an example:

the property of "completiontype" value= "TurnIn" i was going to use <set xpath> but there is no other completion type for me to set it to. the basic survival quest (which is completed without having to turn in or return to trader) does not have a completion type. does anyone know how i can achieve this?


<quest id="challenge_silenceofthelambs">
        <property name="name_key" value="challenge_silenceofthelambs"/>
        <property name="subtitle_key" value="challenge_silenceofthelambs_subtitle"/>
        <property name="description_key" value="challenge_silenceofthelambs_offer"/>
        <property name="icon" value="ui_game_symbol_zombie"/>
        <property name="repeatable" value="true"/>
        <property name="category_key" value="challenge"/>
        <property name="offer_key" value="challenge_silenceofthelambs_offer"/>
        <property name="difficulty" value="insane"/>
        <property name="completiontype" value="TurnIn"/>

        <objective type="RandomGoto" value="500-800" phase="1">
            <property name="completion_distance" value="50"/>
            <property name="nav_object" value="quest" />
        </objective>

        <objective type="RallyPoint">
            <property name="start_mode" value="Create"/>
            <property name="phase" value="2"/>
            <property name="nav_object" value="rally" />
        </objective>

        <action type="SpawnEnemy" id="zombieScreamer" value="2" phase="3"/>
        <objective type="ZombieKill" id="zombieScreamer" value="2" phase="3"/>

        <objective type="InteractWithNPC">
            <property name="phase" value="4"/>
        </objective>

        <reward type="Exp" value="500"/>
        <!-- You can define a range of rewards like <reward type="Item" id="casinoCoin" value="200-500"/> -->
        <reward type="Item" id="casinoCoin" value="350"/>
    </quest>

 

I would try removing the completion type from the quest and then load up the game.  Worst case scenario, it errors out and you need a different idea.  Best case scenario, it doesn't give you an error and it works.  I guess the actual worst case scenario might be that you get no error, use creative mode to get the quest, do said quest, and get nothing for your efforts.  What I like to do is to have a "Test" game save that I hop into and out of as I make changes to my mods to see if they are working, and more importantly, working as I expected them to.  

Hopefully though, just removing that will do the trick.  Though you may need to remove that from all of the challenge quests, I honestly don't have a clue how to use the "contains" parameter in XML yet.  I'm pretty new to this myself.

 

Link to comment
Share on other sites

2 minutes ago, PrimalCarnage said:

I would try removing the completion type from the quest and then load up the game.  Worst case scenario, it errors out and you need a different idea.  Best case scenario, it doesn't give you an error and it works.  I guess the actual worst case scenario might be that you get no error, use creative mode to get the quest, do said quest, and get nothing for your efforts.  What I like to do is to have a "Test" game save that I hop into and out of as I make changes to my mods to see if they are working, and more importantly, working as I expected them to.  

Hopefully though, just removing that will do the trick.  Though you may need to remove that from all of the challenge quests, I honestly don't have a clue how to use the "contains" parameter in XML yet.  I'm pretty new to this myself.

 

i did. i get no error and the quest says "return to trader" after i kill the zombies that are spawned.

this is the code i used.. so let me know if the code is wrong

 

<remove xpath="/quests/quest[contains(@id, 'challenge')]/property[@name='completiontype']" />
Link to comment
Share on other sites

But I still don't understand, is it possible to change yellowish to violet if reddish is bluish?

Quote

 

<item name="gunMGT1AK47">
.....
    <property name="Material" value="MMachineGunParts"/>

    <property name="RepairTools" value="resourceRepairKit"/>
.......

</item>

 

As example, I wanna replace:

Quote

<property name="RepairTools" value="resourceRepairKit"/>

to:

Quote

<property name="RepairTools" value="gunMGT1AK47Parts"/>

ONLY if items contains:

Quote

<property name="Material" value="MMachineGunParts"/>

And so for each item!

Edited by CrazyAluminum (see edit history)
Link to comment
Share on other sites

  • 3 weeks later...
  • 2 weeks later...
  • 1 month later...
On 10/15/2020 at 2:36 AM, CrazyAluminum said:

Is it possible to change



<property name="RepairTools" value="resourceRepairKit"/>

with one line to 



<property name="RepairTools" value="gunMGT1AK47Parts"/>

if



<property name="Material" value="MMachineGunParts"/>

?

 

It's possible to do this with XPath generally, but I don't know if it's supported in the version of XPath used by 7D2D. You could try it and find out.

 

The key is to not think of it as targeting a property node with a sibling property node, whose name and value match. Instead, target the property whose parent item has a child property node, whose name and value match. (It's also more intuitive - you're changing something about a "kind of item.")

 

Here's the XML to do this:

<set xpath="/items/item[/property[@name='Materials' and @value='MMachineGunParts']]/property[@name='RepairTools']/@value">gunMGT1AK47Parts</set>

 

Edited by khzmusik
Cleaned up quoted part (see edit history)
Link to comment
Share on other sites

  • 3 weeks later...

I'm looking to make a modlet that gives vehicles a speed boost for using the roadways around the map. I'm having a real difficult time though trying to figure out where this should be implemented. As a block property, some sort of buff, or something modifying in the vehicle xml itself. Just need a pointer to get the ball rolling, the roads need some love.

Link to comment
Share on other sites

  • 4 months later...

Hi friends. I'm trying to use a conditional to set the value of "SpreadMultiplierAiming" (which is nested within an effect_group) to 0 for all guns.

 

I've tried a couple variations of this:

<set xpath="/items/item[contains(@name, 'gun')]/effect_group/passive_effect[contains(@name, 'SpreadMultiplierAiming')]/@value">0</set>

But none work.

Can I use a conditional statement to navigate into an effect_group like this? Or am I way off?

Link to comment
Share on other sites

  • 1 month later...

Hello all,

 

i just want to create a server side only mod where I would also like to change the models for certain blocks.
Example: I want to create a block that has the forge as a base but should look like a concrete block.
Is that possible?

 

I also wonder if it is possible to paint this new block or to determine a texture from the known paintings. For example, with a red cross for medicine.
Is that possible?

 

I also wonder if I can combine several blocks for one block. By this I mean, for example, to put a lamp or candle on this concrete block.
Is that possible?

 

Finally, where can I find an overview of all the models that are available? There are already some xpaths in this article but I am almost sure that there are more. Is there a link or something?

 

Looking forward to your answers

Link to comment
Share on other sites

  • 2 weeks later...
On 8/1/2021 at 1:30 PM, dwarfmaster1974 said:

i just want to create a server side only mod where I would also like to change the models for certain blocks.
Example: I want to create a block that has the forge as a base but should look like a concrete block.
Is that possible?


Do you mean a forge that looks like a concrete block in simple terms? Yes, this is possible.

 

Quote

I also wonder if it is possible to paint this new block or to determine a texture from the known paintings. For example, with a red cross for medicine.
Is that possible?

 

Can this new concrete forge block be painted? Yes

 

Quote

I also wonder if I can combine several blocks for one block. By this I mean, for example, to put a lamp or candle on this concrete block.
Is that possible?


Do you mean that the block has the appearance of a concrete block with a candle on top of it - but is actually only 1 block?
Yes, this is possible, but not as simple as changing codes around. You would need to create a block in a program like Unity with this appearance then export it as a unity3d file.
Then link to this model in the xml and change the MultiBlockDim value to "1,2,1".

 

Quote

Finally, where can I find an overview of all the models that are available? There are already some xpaths in this article but I am almost sure that there are more. Is there a link or something?


I haven't read all of this article but a good starting point is to browse through the ItemIconAtlas folder

Link to comment
Share on other sites

Hi @Vincenzo,

 

Thanks for your answer!

Of course, it would be great if I knew what that would look like:

Quote

Do you mean a forge that looks like a concrete block in simple terms? Yes, this is possible.


A small example would be super helpful.

 

Quote

Can this new concrete forge block be painted? Yes


Again, a small example would really help me.🙂

Quote

Do you mean that the block has the appearance of a concrete block with a candle on top of it - but is actually only 1 block?


No. Only one block of cement and one block on top of it. Dimension can then be 1,2,1. But I don't want to create any new unitity models, because I want to run the server in question without an additional mod installation.

Quote

 I haven't read all of this article but a good starting point is to browse through the ItemIconAtlas folder.


Do you mean the folder that contains PNG files that represent the images of the individual items and blocks? Or are you talking about a different directory.


I am looking forward to your answer

 

 

Link to comment
Share on other sites

Hi All - 

This part as been stumping me for a bit. I thought I had it, but then it turns out I had been fooling myself and I really had just been removing the attribute itself and not the values of the attribute, which is what i'm after. 

Here's a bit of what I'm wanting to do.

@ lvl 1 in skill in GreaseMonkey, everyone has the ability to create wheels, bike chassis, and bike handlebars. 
@ lvl 2 in skill, this expands to everyone can now create a bar battery, make gas, and engineer a minibike chassis and minibike handlebars.  

(and so on and so forth).

For this exercise, what I wanted to do was say... yaaaaah. NO,  INSTEAD, all you can do is find the chassis/handlebars for the minibike in loot or on vendors to purchase. The schematic to learn how to make the chassis and handlebars doesn't even exist.... and oh yeah - you have to be skill lvl 1 to even understand how to assemble a minibike now. So unskilled players can no longer just luck into finding all the parts in the world and just make a minibike out of their magic backpacks.

This is the code I had been playing with, with some success, but of course, there's things I'm just not getting as to why it's not exactly working. 

 

progression.xml
<TEST>
<removeattribute xpath="/progression/perks/perk[@name='perkGreaseMonkey']/effect_group/passive_effect[@level='1,5']/@tags">,vehicleBicycleChassis</removeattribute>
<append xpath="/progression/perks/perk[@name='perkGreaseMonkey']/effect_group/passive_effect[@level='1,5']/@tags">,vehicleBicyclePlaceable</append>
<removeattribute xpath="/progression/perks/perk[@name='perkGreaseMonkey']/effect_group/passive_effect[@level='2,5']/@tags">vehicleMinibikeChassis,vehicleMinibikeHandlebars</removeattribute>
<append xpath="/progression/perks/perk[@name='perkGreaseMonkey']/effect_group/passive_effect[@level='2,5']/@tags">,vehicleMinibikePlaceable</append>
</TEST>

loot.xml snip
<TEST>
<removeattribute xpath="/lootcontainers/lootgroup[@name='schematicsVehiclesT1']/[@item='vehicleMinibikeChassisSchematic']"></removeattribute>
<removeattribute xpath="/lootcontainers/lootgroup[@name='schematicsVehiclesT1']/[@item='vehicleMinibikeHandlebarsSchematic']"></removeattribute>
</TEST>

items.xml snip
<TEST>
<remove xpath="/items/item[@name='vehicleMinibikeChassisSchematic']"/>
<remove xpath="/items/item[@name='vehicleMinibikeHandlebarsSchematic']"/>
</TEST>

traders.xml
<TEST>
<removeattribute xpath="/traders/trader_item_groups/trader_item_group[@name='schematicsVehiclesCommon']/[@item='vehicleMinibikeChassisSchematic']"/>
<removeattribute xpath="/traders/trader_item_groups/trader_item_group[@name='schematicsVehiclesCommon']/[@item='vehicleMinibikeHandlebarsSchematic']"/>
</TEST>


So yeah. Lots of failing code comes out of this of course. I've tried variations on a lot of different moving parts. I started by just trying to focus on one file (of course), and only get the one thing working. 

 

This by the way is litterally all it's doing to the progression.xml file
<perk name="perkGreaseMonkey" parent="skillIntellectCraftsmanship" name_key="perkGreaseMonkeyName" desc_key="perkGreaseMonkeyDesc" icon="ui_game_symbol_service">
		<level_requirements level="1"><requirement name="ProgressionLevel" progression_name="attIntellect" operation="GTE" value="2" desc_key="reqIntellectLevel02" /></level_requirements>
		<level_requirements level="2"><requirement name="ProgressionLevel" progression_name="attIntellect" operation="GTE" value="4" desc_key="reqIntellectLevel04" /></level_requirements>
		<level_requirements level="3"><requirement name="ProgressionLevel" progression_name="attIntellect" operation="GTE" value="6" desc_key="reqIntellectLevel06" /></level_requirements>
		<level_requirements level="4"><requirement name="ProgressionLevel" progression_name="attIntellect" operation="GTE" value="8" desc_key="reqIntellectLevel08" /></level_requirements>
		<level_requirements level="5"><requirement name="ProgressionLevel" progression_name="attIntellect" operation="GTE" value="10" desc_key="reqIntellectLevel10" /></level_requirements>

		<effect_group>
			<passive_effect name="CraftingTier" operation="base_set" level="0,5" value="0,5" tags="perkGreaseMonkey" /><!-- fake crafting perk that is used to scale resources or quality like on carBattery -->

			<passive_effect name="RecipeTagUnlocked" operation="base_set" level="1,5" value="1"><!--Attribute "tags" removed by: "TEST-MOD"--></passive_effect>
			<passive_effect name="RecipeTagUnlocked" operation="base_set" level="2,5" value="1"><!--Attribute "tags" removed by: "TEST-MOD"--></passive_effect>
			<passive_effect name="RecipeTagUnlocked" operation="base_set" level="3,5" value="1" tags="resourceOil,vehicleMotorcycleChassis,vehicleMotorcycleHandlebars" />
			<passive_effect name="RecipeTagUnlocked" operation="base_set" level="4,5" value="1" tags="ammoGasCanBundle,vehicle4x4TruckChassis,vehicle4x4TruckAccessories" />
			<passive_effect name="RecipeTagUnlocked" operation="base_set" level="5" value="1" tags="vehicleGyroCopterChassis,vehicleGyroCopterAccessories" />

			<effect_description level="1" desc_key="perkGreaseMonkeyRank1Desc" long_desc_key="perkGreaseMonkeyRank1LongDesc" />
			<effect_description level="2" desc_key="perkGreaseMonkeyRank2Desc" long_desc_key="perkGreaseMonkeyRank2LongDesc" />
			<effect_description level="3" desc_key="perkGreaseMonkeyRank3Desc" long_desc_key="perkGreaseMonkeyRank3LongDesc" />
			<effect_description level="4" desc_key="perkGreaseMonkeyRank4Desc" long_desc_key="perkGreaseMonkeyRank4LongDesc" />
			<effect_description level="5" desc_key="perkGreaseMonkeyRank5Desc" long_desc_key="perkGreaseMonkeyRank5LongDesc" />
		</effect_group>
	</perk>

 

 

So clearly - it's not doing the equivalent of a "replace" function, which is probably all I'd really need.  I could probably do this all with a set, where I just set the effects to a start point I want, and then use append to add in the recipes to them, so that the tags attribute doesn't get removed....

OH ok.. all this typing I might have just got it out loud. It's cause it's removing the TAG attribute that the entire set of values is going poof and it can't append the placeable minibike.

So what's the correct way to do it? Just using <remove xpath="/.... etc... "  ????
Would this also explain why it's not being removed from the traders.xml or the loot.xml?

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...