Jump to content

sphereii

Members
  • Posts

    3,069
  • Joined

  • Last visited

  • Days Won

    23

Everything posted by sphereii

  1. Previously, we've just covered the set command to change individual values. The following commands are also supported in xpath. There may be more, but these are the ones that will cover most of our uses. <set xpath=""> - Allow you to change a value Example: This line changes loot container id 62, and changes it's size to 7,6. <set xpath="/lootcontainers/lootcontainer[@id='62']/@size">7,6</set> <append xpath=""> - This allows you to add whatever XML exists in between the <append> and </append>, at the end of the location in xpath, but still within its scope. You can use the append to add large chunks of XML nodes. Example: This line adds in a new entity to the bottom of the entity_classes. It will be added within the top level <entity_classes> </entity_classes> xml. <append xpath="/entity_classes"> <entity_class name="PassiveFlight" extends="animalChicken"> <!-- snip --> </append> - It also may allow us to append a value to an existing value. ( This needs testing ) Example: This line could potentially add NoAmmo to the existing value of 9mmBullet. <append xpath="/items/item/property[@class='Action0']/property[@name='Magazine_items' and @value='9mmBullet']/@value">,NoAmmo</append> <insertAfter xpath=""> - Allows you to add nodes after the specified xpath. It finds the XML node you are searching for, and adds whatever is inside the <insertAfter> blocks after that. Example: The snippet bellow allows you to add in the new panel in the windowVehicleStats window, after the rect called 'content', in the XUi/windows.xml: <insertAfter xpath="/windows/window[@name='windowVehicleStats']/rect[@name='content']" > <panel pos="240, 0" style="header.panel"> <sprite style="header.icon" sprite="ui_game_symbol_add"/> <label style="header.name" text="COMBINE" text_key="xuiCombine"/> </panel> </insertAfter> <insertBefore xpath=""> - Same as insertAfter above, but adds in the new XML before the node that matches the specified xpath. <remove xpath=""> - Allows you to remove an XML node Example: This snippet was used in the ClearUI. It removed the HUDLeftStatBars from the UI. <remove xpath="/xui/ruleset[@name='default']/window_group[@name='toolbelt']/window[@name='HUDLeftStatBars']" /> <setattribute xpath=""> - Allows you to add a new attribute Example: This adds a new max_level attribute to the attribute with the name attPerception <setattribute xpath="/progression/attributes/attribute[@name='attPerception']" name="max_level">1000</setattribute> <removeattribute xpath=""> - Allows you to remove an attribute ( New in A18 ) Example: This will remove the value attribute <removeattribute xpath="/progression/attributes/attribute[@name='attPerception']/@value" />
  2. Previously, we've covered the set command, that let us change individual values and attributes. I'd like to dedicate this section to the append command, since it will likely be the second most used xpath command. The append command can do two things: Add a large block of new XML, or add on an additional value.. [ Additional Value ] In the previous post, we covered how to add the NoAmmo mod using the set command. In that example, we had to also specify the existing value of, then add NoAmmo to it: <set xpath="/items/item/property[@class='Action0']/property[@name='Magazine_items' and @value='9mmBullet']/@value">9mmBullet,NoAmmo</set> The append command can help us make this a little bit easier. Using append, we won't have to specify the existing value, but rather just what we want to add to it: <append xpath="/items/item/property[@class='Action0']/property[@name='Magazine_items' and @value='9mmBullet']/@value">,NoAmmo</append> [ Additional Nodes ] The other way that append can help us is by adding larger blocks of code. I'll use a part of xyth's Junk Items mod to show where we can add multiple items to the items.xml. The xpath specifies append to the bottom of the /items node. This keeps it within the <items> </items> blocks, but adds it to the end of the file. Mods/JunkItems/Config/items.xml: <configs> <append xpath="/items"> <!-- items needed to scrap Xyth junk into --> <item name="itemMaster"> <property name="Meshfile" value="Items/Misc/sackPrefab" /> <property name="DropMeshfile" value="Items/Misc/sack_droppedPrefab" /> <property name="Material" value="organic" /> <property name="HoldType" value="45" /> <property name="Stacknumber" value="500" /> <property name="Weight" value="5" /> <property name="Group" value="Resources" /> <property name="SellableToTrader" value="false" /> </item> <item name="scrapSteel"> <property name="Extends" value="itemMaster" /> <property name="CustomIcon" value="ui_game_symbol_scrapSteel" /> <property name="Material" value="Msteel" /> <property name="Weight" value="1" /> <property name="MeltTimePerUnit" value="0.5" /> <property name="RepairAmount" value="10" /> </item> </append> </configs> Note that we are closing the </append> at the end of the items we are adding.
  3. XPath Dissected XPath may look a bit intimidating to people unfamiliar with the syntax. Let's see if we can go through an example explaining the format of a simple xpath. To start off, we'll be using the xpath command for set, which lets us change an attribute, or value. Another post will show more of xpath commands, but we'll begin with the simplest. All of the xpath commands take an xpath="" parameter that tells the game where you want to make a change. A change is either changing a value, removing a value, adding a new entity, or whatever you are trying to do. For this example, we want to change the size of the minibike container. <lootcontainers> <!-- Other loot container lines --> <!-- minibike storage --> <lootcontainer id="62" count="0" size="4,3" sound_open="UseActions/open_shopping_basket" open_time="0" sound_close="UseActions/close_shopping_basket" loot_quality_template="baseTemplate"> </lootcontainer> <!-- other loot container lines --> </lootcontainers> We need to be able to identify the XML node we want, as precisely as we can. Since the lootcontainers' contain an ID, we'll see that as our target. We want to actually change the size attribute, but it's not unique enough to find directly. We want to give xpath the direct path to there we want to make a change at. When we want to reference the XML nodes in xpath, we'll use the / separator. [highlight]xpath="/lootcontainers/lootcontainer" [/highlight] gets us pretty close. However, there are a lot of lootcontainters, and we only want to change the one with the ID of 62. The ID is an attribute, so we'll have to set a condition to check to make sure the attribute matches 62. [highlight]xpath="/lootcontainers/lootcontainer[@id=62][/highlight] gets us to the right loot container. There's no other lootcontainer with an id of 62, so we won't run the risk of changing more than we want. But we wanted to change the size attribute specifically. [highlight]xpath="/lootcontainers/lootcontainer[@id=62]/@size"[/highlight] gives us direct access to the value in size. So our full set xpath command would look like this: <set xpath="/lootcontainers/lootcontainer[@id='62']/@size">7,6</set> Here's another example. This time, we want to add a new ammo type called "NoAmmo" to the gunPistol. With the loot container, we only wanted to modify a single container. For the ammo type, we want to add NoAmmo to every gun that uses 9mmBullet. There could be a single gun for that, or there could be multiple guns that use it. Either way, we want to change them all. Since we are changing all guns that uses 9mmBullet, we don't have to specify an ID or name. Instead, we'll be looking for every Magazine_items that also has a value of "9mmBullet". Here's a snippet of the XML. To save space, I removed the extra lines, and left just the ones we want to see. <items> <item id="40" name="gunPistol"> <!-- snip --> <property class="Action0"> <!-- snip --> <property name="Magazine_items" value="9mmBullet" /> </property> </item> </items> Here's the full xpath code: <set xpath="/items/item/property[@class='Action0']/property[@name='Magazine_items'][@value='9mmBullet']/@value">9mmBullet,NoAmmo</set> For every item that has a property class of "Action0", that has a property called "Magazine_Items" with a value of 9mmBullet, change the value to 9mmBullet,NoAmmo Note the [highlight] [@name=Magazine_items][@value=9mmBullet][/highlight] ? We are telling xpath that the property name has to be Magazine_Items, AND its value has to be 9mmBullet, before we add NoAmmo. Why do we need to check the property name and its value? Because of things like the paintTool item, which has a Magazine_items with a value of paint. We don't really need to change that one.
  4. This is a large amount of information in these posts. I'll be working on a full, properly formed tutorial as we get access to A17 and we can really make the xpath system shine. I've listed some examples here, and we'll be posting a ton more xpath samples over the coming weeks, as we port the SDX modlets over to use the native hooks. By all means, begin posting your comments, questions, or requests for clarity. Since we now know that xpath support will be built-into the vanilla base game, and discussions earlier were getting a bit confusing, I've decided to make a new thread to try to demystify xpath and what it'll mean for mods and modders going forward in A17. The information in this thread has been pieced together from forum and discord discussions. They may not be 100% accurate, but I will update this thread when we know the full implementation. XPath is a way of adding, changing, or removing XML lines and nodes, without directly editing the XML files. It allows you to apply patches to the XML files without manually editing the vanilla XML files. SDX has had partial support for this since its initial release, and a lot of the SDX Modlets are already written this way. We will be using some of the SDX's xpath as examples in this thread, but SDX is not required to do this in A17 and onwards. I believe in using examples to explain concept, so in the next few posts, you'll see a mixture of explanation, along with sample xpath code. The following Mod structure is expected for A17 and beyond: Mods/ <ModName>/ Config/ UIAtlases/ItemIconAtlas/ ModInfo.xml <ModName2>/ Config/ ModInfo.xml You will be able to have multiple mods loaded, and loading will occur as long as the ModInfo.xml exists. This is unchanged from what we've been doing doing with other alphas, with the exception of the Config folder. This Config folder will support loading XML files, written using xpath, in the following folder structure: Config/entityclasses.xml Config/gamestages.xml Config/items.xml The files in the Config folder will not be a full copy of the vanilla file with your changes. Rather, it'll contain the changes you want done to the vanilla files. The files under the Config must match the vanilla file name. You cannot create an entityclasses2.xml file, and expect it to work. Any changes in the entityclasses.xml will have to be done in the same file. However, each mod can have its own entityclasses.xml. During the game's initialization, it will perform the xpath merge in-memory only; no files will be actually be modified. This would allow us to remove mods we no longer want, without re-validating against steam, or previous copies of the xml. That's a big one. No more half merging of a mod, and not having it work, then trying to pull it back out. What this means for us is that we'll be able to make a variety of smaller mods, which I've been calling modlets, which can add, remove and change smaller pieces of the game. They can be used together, or they could be added to an overhaul mod, in order to style your game play easier. These modlets would also exists outside of the Data/Config folder, so if you have made direct XML changes in your Alpha 17.1 Data/Config files, and Steam updated the game to 17.2, you would have lost your changes, or would have to re-merge them in. We've all been there before. But if they existed as modlets, under the Mods folder, they would be safe. And as long as your xpath is still valid to the new XML, it should load up with no additional work on your part. If we could use xyth's JunkItems modlet, which adds random, scrappable junk items to loot containers, and add them to Valmod Overhaul. Likewise, if Valmod Overhaul did not have the No Ammo modlet (which gives you the ability to unload a gun and get its bullets back without disassembling it), you could drop the NoAmmo modlet into your Mods folder. Headshots only? Want to increase stack sizes? Same deal. With a properly constructed modlet, we'll be able to piece together new play styles for people to enjoy and share. A modder working on a large overhaul won't have to duplicate work. If they wanted to include the No Ammo mod, they wouldn't have to code it themselves, letting them focus on the bits that make their mod really unique. Let's get started on your journey...
  5. I added it. Restart your Mod Launcher and it should be available
  6. Yes, when it shows up in the list to download, I'll add it to the list
  7. No problem. With Refresh Mods Automatically, it talks to github to check to see if there's any updates. This will only take a few seconds. Each time you play, it does copy the files over. This is a 'safety' feature in case someone makes a mistake if they are editing the mod. We try to avoid needless support request to the modders for changes that the user makes. Its more noticeable if you are using a regular hard drive, rather than a solid state.
  8. I am sorry that I did not see this earlier. Are you using Windows 8.1? I thought the .1 was a free update. - - - Updated - - - It uses Github, so it should only download what has changed each time; often times that would be nothing. Is it taking awhile to download each time? If you have Direct Download checked, it'd by-pass the shortcut, and do a full download each time. Uncheck that to make it work as expected. You could also uncheck Refresh mods Automatically.
  9. Oh dear. Sorry for the trouble. Try this: https://support.microsoft.com/en-ca/help/2713442/clickonce-application-fails-to-update o delete the ClickOnce file cache delete the contents of this folder based on the operating system. Windows XP and Server 2003 - %userprofile%\Local Settings\Apps\2.0\*.* Windows Vista and Server 2008 and later - %userprofile%\AppData\Local\Apps\2.0\*.* Deleting these files will clear the information for all installed ClickOnce applications. They will re-install the next time their shortcut or URLs are used.
  10. Hi Kevin1000 Seems like EAC is still being loaded. Can you go to your 7 days to die folder, and run the 7Dlauncher.exe directly, unchecking Use EAC?
  11. Try this: https://github.com/SphereII/Release/archive/master.zip Download, and extract, and run 7d2dlauncher.exe directly. It will skip the .NET check that is causing the issue.
  12. Sorry for the trouble. Have you tried to reboot? Sometimes that helps with this error
  13. Some ISPs change their policy on whether to allow SSL or not. It's no bother; enjoy the mods
  14. Seems like something is blocking the launcher from reading the list. Can you click on Disable SSL, and restart the mod launcher?
  15. I am glad things worked out for you enjoy the mods
  16. There's a two main ways: 1) In the game's Multiplayer screen, enter in your IP address and the port, to allow a direct connect. 2) Add the 7d2dmodlauncher.exe ( https://7d2dlauncher.blob.core.windows.net/installer/7D2DModLauncher.exe ) to Steam as a non-Steam game. Then launch the mod launcher from steam. Open your overlay (SHIFT-TAB) and try to join that way - - - Updated - - - I am sorry that this is the awkward solution for you. I've found a few ISPs that have been hostile to github links in the past, and there's not that many ways around it.
  17. This error is being generated by windows, saying that the file is locked, or in-use. Common reasons for that would be either the file was open for edit elsewhere, anti-virus was scanning it, or windows was doing something else with it. If you have anti-virus or anti-spyware, I'd suggest adding an exclusion to the top level folder, like C:\7D2D in your case.
  18. Once loaded, would you mind clicking on the View menu, then Log files, and clicking on Upload Log file? It'll give you a pastebin.com link of the start up; might be able to see what's going on with it. Sounds like something is blocking the site.
  19. Sorry for the delay. This sounds like something is blocking the github link. Can you click on Disable SSL, and re-launch the mod launcher to see if it fixes it?
  20. Sorry for the delay in answering. It seems like one of the settings is bad in the game. Does the launcher start at all, or just errors out and stops you from continueing? If it does continue to launch, you can go to File -> Clear -> Clear Steam Paths, and see if that helps.
  21. It may have been a temporary disruption. I just loaded it up. Would you mind re-trying?
  22. I'm sorry that you are experiencing this issue. I've reviewed your log files, and haven't seen anything too alarming yet. What kind of anti-virus software do you have? Any other kind of performance-tuning software installed?
  23. My guess is that JaxTeller718 didn't want to change the name of the mod when he updated it to 4.2. The "name" of the mod in the Mod Launcher is used for the folder; changing this name would have forced everyone to re-install the mod completely.
  24. According to the description, 41 in the mod launcher is 4.2.
×
×
  • Create New...