Jump to content

A16 - 7D2D SDX Tutorials and Modding Kit


sphereii

Recommended Posts

When the tutorials were first written, War of the Walkers was not an SDX Mods. It has since moved into SDX territory, so that section will be on the chopping block. With A17 on the horizon, the SDX tutorials will be updated once we figure it out.

 

The bigger back pack mod, I think, was broken when I added the Tool belt issue. I was working on CNS at the time, and I think I committed the wrong UI XML. I'll see if I can look at it in the next day or two and fix it.

 

Ok thanks a lot, everything makes more sense to me now. ;)

 

Another small question if you don't mind. One of my goals with SDX would be to make new meshes for the new weapons I have in my mod, but I'd like to have new particles on the weapons. Is it possible to export Unity particles on the new weapons with the toolset you guys are providing? For example I'd like to make a Fire Spiked Club and a Lightning Spiked Club. Maybe this is covered in the tutorials, I haven't found it yet.

 

Thanks again!

Link to comment
Share on other sites

I haven't pulled particles FROM the game yet, but I've certainly added many... Easy peasy, add them as children to the object, and remove all script references.

 

Not being able to pull them from the game is fine, I can just create new ones in Unity.

But just to make sure I understand your explanation, you are talking about putting the particle child of the object in Unity, right? And then the exporter will just export the whole thing and it will show up in the game without having to specify a particle effect in the game's xmls, right?

And remove all scripts references in Unity? Does the exporter really care about Unity scripts, can it actually do something with them?

Link to comment
Share on other sites

Not being able to pull them from the game is fine, I can just create new ones in Unity.

But just to make sure I understand your explanation, you are talking about putting the particle child of the object in Unity, right? And then the exporter will just export the whole thing and it will show up in the game without having to specify a particle effect in the game's xmls, right?

And remove all scripts references in Unity? Does the exporter really care about Unity scripts, can it actually do something with them?

 

The exporter will add the scripts as a Text object inside of the unity bundle; not the compiled version. As a safety feature of asset bundles, it won't load code.

 

What it does, is adds the scripts as a text object. In your C# code, you'd have to read the text from the bundle, then use an on-the-fly compiler to compile it, then try to attach it to your object. That's the theory, anyway.

Link to comment
Share on other sites

The exporter will add the scripts as a Text object inside of the unity bundle; not the compiled version. As a safety feature of asset bundles, it won't load code.

 

What it does, is adds the scripts as a text object. In your C# code, you'd have to read the text from the bundle, then use an on-the-fly compiler to compile it, then try to attach it to your object. That's the theory, anyway.

 

Ok thanks, I will finish the tutorials to make sure I understand these kind of details.

Can you tell me if the other tutorials are still valid?

Link to comment
Share on other sites

All tutorials listed on SphereIi's tutorial site are valid for A16.4 7DaytoDie. My videos follow his tutorial text, mostly :-)

 

I was asking because a couple of them are broken, SphereIi comfirmed that a couple of posts ago in this thread.

So far the ones broken I found are: bigger backpack, neon sign and modding on top of war of the walkers.

Link to comment
Share on other sites

SDX is so awesome, you guys rock!!!

 

Putting full visuals on my custom over powered magical melee weapons was way easier than I thought. Brought the particles easily and even the weapon lights too.

 

 

I can push this mod on the Mod Helper tool if you guys want. But I need to know how to do that, not sure I saw explanations in the docs.

And when I tried downloading mods through it, it opened a bunch of dos windows but it did nothing, I had to download the mods from github.

 

I also noticed that the SDX Launcher does not patch the Localization file, even though it says it does when you build. I have my localization file in the Text directory like all other mods.

 

Thanks again, I'm so happy I was able to do that so easily!

Link to comment
Share on other sites

Hi,

I got a problem with transferring another mod to SDX.

When I build the mod with SDX, I get this error when it tries to load blocks:

Exception: Block with name 'minerRegularOres' not found!

 

In the ouput_log.txt files, there is also 3 suspicious lines before it and a bit more details:

 

d3d: failed to create 2D texture id=1587 w=1 h=1 mips=1 d3dfmt=894720068 [invalid call]
d3d: failed to create 2D texture id=1591 w=1 h=1 mips=1 d3dfmt=894720068 [invalid call]
d3d: failed to create 2D texture id=1585 w=1 h=1 mips=1 d3dfmt=894720068 [invalid call]
Exception: Block with name 'minerRegularOres' not found!
 at BlockPlantGrowing.LateInit () [0x00000] in <filename unknown>:0 
 at Block.LateInitAll () [0x00000] in <filename unknown>:0 
 at WorldStaticData.Init (System.String _name, .XmlFile _xmlFile) [0x00000] in <filename unknown>:0 
 at WorldStaticData+NN.MoveNext () [0x00000] in <filename unknown>:0 
 at UnityEngine.SetupCoroutine.InvokeMoveNext (IEnumerator enumerator, IntPtr returnValueAddress) [0x00000] in <filename unknown>:0 

(Filename:  Line: -1)

 

 

If instead of building, I manually copy all the xml pieces in my working directory xmls, everything works fine.

It's a fairly simple MOD with no C# scripts, only xml additions and a custom block prefab, so I don't get why SDX would make this behave differently then when I manually copy everything. And all my other similar mods work fine when building.

 

Is this a good place to send questions about problems, should I use the Q&A site instead?

I can send my mod files if someone is willing to take a look.

 

Thanks!

Link to comment
Share on other sites

SDX is so awesome, you guys rock!!!

 

I also noticed that the SDX Launcher does not patch the Localization file, even though it says it does when you build. I have my localization file in the Text directory like all other mods.

 

Thanks again, I'm so happy I was able to do that so easily!

 

Localization works in SDX. Folder should be named Text , and file should be named localization.txt

 

- - - Updated - - -

 

Hi,

I got a problem with transferring another mod to SDX.

When I build the mod with SDX, I get this error when it tries to load blocks:

Exception: Block with name 'minerRegularOres' not found!

 

In the ouput_log.txt files, there is also 3 suspicious lines before it and a bit more details:

 

d3d: failed to create 2D texture id=1587 w=1 h=1 mips=1 d3dfmt=894720068 [invalid call]
d3d: failed to create 2D texture id=1591 w=1 h=1 mips=1 d3dfmt=894720068 [invalid call]
d3d: failed to create 2D texture id=1585 w=1 h=1 mips=1 d3dfmt=894720068 [invalid call]
Exception: Block with name 'minerRegularOres' not found!
 at BlockPlantGrowing.LateInit () [0x00000] in <filename unknown>:0 
 at Block.LateInitAll () [0x00000] in <filename unknown>:0 
 at WorldStaticData.Init (System.String _name, .XmlFile _xmlFile) [0x00000] in <filename unknown>:0 
 at WorldStaticData+NN.MoveNext () [0x00000] in <filename unknown>:0 
 at UnityEngine.SetupCoroutine.InvokeMoveNext (IEnumerator enumerator, IntPtr returnValueAddress) [0x00000] in <filename unknown>:0 

(Filename:  Line: -1)

 

 

If instead of building, I manually copy all the xml pieces in my working directory xmls, everything works fine.

It's a fairly simple MOD with no C# scripts, only xml additions and a custom block prefab, so I don't get why SDX would make this behave differently then when I manually copy everything. And all my other similar mods work fine when building.

 

Is this a good place to send questions about problems, should I use the Q&A site instead?

I can send my mod files if someone is willing to take a look.

 

Thanks!

 

Its almost definitely not an SDX issue, but rather a typo issue. Capitalization and exact spelling matters, or the sdx package containing the block wont be loaded then wont be found.

Link to comment
Share on other sites

Localization works in SDX. Folder should be named Text , and file should be named localization.txt

 

- - - Updated - - -

 

 

Its almost definitely not an SDX issue, but rather a typo issue. Capitalization and exact spelling matters, or the sdx package containing the block wont be loaded then wont be found.

 

Yes, about localization, like I said, this is exactly what I have like all other mods. I tried both names Localization.txt and localization.txt (lower case L), but no luck with both. Some mods have the first letter uppercase and some have it lowercase, and I noticed that mods like fishing also don't copy their localization file, so it's not just mine.

 

About SDX, I am copy-pasting everything, so there is no typo issue here. If there was, it wouldn't work in both of my tests (with SDX building and with manual copying).

 

Unless it's because I have an old version of SDX or something. It says 0.7.1.

Link to comment
Share on other sites

Ok I think I found why SDX fails. Blocks.xml has a limit of 2047 ids, and since SDX only starts adding new ids from the last ID present in the file (2041), it means that we only have 6 available free blocks if we want to use the auto-assign ids feature.

 

My new mod was busting the 2047 limit, that's why it couldn't find block 2048. ;)

I'll just assign fixed ids on my blocks for now. This will be a problem if other mods use the same ids though...

At least I can use the feature for items since I don't think there is an id max for items.xml.

 

I saw Sphereii saying this feature would be in the next version, is it only for when you guys will work on A17?

Link to comment
Share on other sites

Ok I think I found why SDX fails. Blocks.xml has a limit of 2047 ids, and since SDX only starts adding new ids from the last ID present in the file (2041), it means that we only have 6 available free blocks if we want to use the auto-assign ids feature.

 

My new mod was busting the 2047 limit, that's why it couldn't find block 2048. ;)

I'll just assign fixed ids on my blocks for now. This will be a problem if other mods use the same ids though...

At least I can use the feature for items since I don't think there is an id max for items.xml.

 

I saw Sphereii saying this feature would be in the next version, is it only for when you guys will work on A17?

 

Try this: http://7d.l9000.co.uk/SDTD/SDTD.asmx/GetLatestSdxDownload

Link to comment
Share on other sites

Ok thanks, trying now...

 

Is this a "alpha" version or really the latest release?

I can't remember how I got the ModdingKit, I think it was from the links at the beginning of this thread. Is there a newer full modding kit, or is it just SDX that has a newer version?

Link to comment
Share on other sites

Ok thanks, trying now...

 

Is this a "alpha" version or really the latest release?

I can't remember how I got the ModdingKit, I think it was from the links at the beginning of this thread. Is there a newer full modding kit, or is it just SDX that has a newer version?

 

Its stable and latest release. 0.7.2.

 

The modding kit is just a collection of tools to help get you started. If you are this far, you don't really need it :)

Link to comment
Share on other sites

Its stable and latest release. 0.7.2.

 

The modding kit is just a collection of tools to help get you started. If you are this far, you don't really need it :)

 

The link you put up downloaded 0.7.3, and it doesn't seem to work. (and my antivirus really doesn't like it ;))

It copies the Mods in individual folders in the Mods directory of the Working folder, but none of the xmls get patched.

 

It also complains about dependencies for Zombie Transmogrifier to HallDll Fixes, but I think the version of Transmo I have already contains the Dll fixes, and I got 2 or 3 versions of HallDll Fixes, not sure which to use.

 

I asked earlier about the Mod Helper not downloading mods, is this working for you? If that would ensure downloading the latest version of each mode, it would be nice. ;) (I guess that was the original intent)

Link to comment
Share on other sites

The link you put up downloaded 0.7.3, and it doesn't seem to work. (and my antivirus really doesn't like it ;))

It copies the Mods in individual folders in the Mods directory of the Working folder, but none of the xmls get patched.

 

It also complains about dependencies for Zombie Transmogrifier to HallDll Fixes, but I think the version of Transmo I have already contains the Dll fixes, and I got 2 or 3 versions of HallDll Fixes, not sure which to use.

 

I asked earlier about the Mod Helper not downloading mods, is this working for you? If that would ensure downloading the latest version of each mode, it would be nice. ;) (I guess that was the original intent)

 

https://github.com/SphereII/SDXWorkshop/blob/master/SDX0.7.2c.zip

 

Try that :)

Link to comment
Share on other sites

 

Ah, much better. The other one was scary and had a gazillion dlls in there.

 

Localization still doesn't work for me, but auto-id-assign is now using free ids from the first id, awesome!

 

2 more questions, sorry for bombing you with questions, I'm putting a lot of time in this right now, but I am very new to all this, I don't have all the baggage you guys have.

 

- Is it planned to try to do something for auto-assigning loot container ids?

I know this one must be more tricky having to do the bridge with the Lootlist properties in blocks.xml, but maybe if we used special characters to define them or something...

 

- Is there a way to append a new item within an xml value that already contains multiple items separated by ','?

For example when you want to just add a new resource item for a constructions tools 'Allowed_upgrade_items' property. If not I guess we need to set it with the full string that contains all the previous elements + our new ones.

This one would be nice too, I often add items to that property and if other mods do, it will also create problems.

 

Thanks for reacting so quickly for the newer version, it's very appreciated!

Link to comment
Share on other sites

Oh by the way, since I now have a version that works better, I'm tempted to port all my other mods, and I have many.

If those can be helpful for making more tutorials I'll be happy to share... maybe I could also find some time to make a couple tutorials or vids...

Link to comment
Share on other sites

Ah, much better. The other one was scary and had a gazillion dlls in there.

 

Localization still doesn't work for me, but auto-id-assign is now using free ids from the first id, awesome!

 

2 more questions, sorry for bombing you with questions, I'm putting a lot of time in this right now, but I am very new to all this, I don't have all the baggage you guys have.

 

- Is it planned to try to do something for auto-assigning loot container ids?

I know this one must be more tricky having to do the bridge with the Lootlist properties in blocks.xml, but maybe if we used special characters to define them or something...

 

- Is there a way to append a new item within an xml value that already contains multiple items separated by ','?

For example when you want to just add a new resource item for a constructions tools 'Allowed_upgrade_items' property. If not I guess we need to set it with the full string that contains all the previous elements + our new ones.

This one would be nice too, I often add items to that property and if other mods do, it will also create problems.

 

Thanks for reacting so quickly for the newer version, it's very appreciated!

 

Not sure about the lootcontainer, for the reason you already specified. That connection can be tricky. But if there's no more block ids in A17, we'll have to see what's in the loot.xml for references. if its strings, rather than numbers, we may be able to do something.

 

Take a look at the NoAmmo Mod. It searches for 9mmBullet, and replaces it with 9mmBullet,NoAmmo.

 

		<set xpath="/items/item/property[@class='Action0']/property[@name='Magazine_items'][@value='9mmBullet']/@value">9mmBullet,NoAmmo</set>
		<set xpath="/items/item/property[@class='Action0']/property[@name='Magazine_items'][@value='44MagBullet']/@value">44MagBullet,NoAmmo</set>

Link to comment
Share on other sites

Not sure about the lootcontainer, for the reason you already specified. That connection can be tricky. But if there's no more block ids in A17, we'll have to see what's in the loot.xml for references. if its strings, rather than numbers, we may be able to do something.

 

Take a look at the NoAmmo Mod. It searches for 9mmBullet, and replaces it with 9mmBullet,NoAmmo.

 

		<set xpath="/items/item/property[@class='Action0']/property[@name='Magazine_items'][@value='9mmBullet']/@value">9mmBullet,NoAmmo</set>
		<set xpath="/items/item/property[@class='Action0']/property[@name='Magazine_items'][@value='44MagBullet']/@value">44MagBullet,NoAmmo</set>

 

Ok thanks, but this seems to still replace the whole string, right? At least that's what it looks like in NoAmmo, and from the quick tests I did.

 

I would like to be able to insert a new item in the string without specifying the whole thing, because if multiple mods add items to the same string value, they will step on each others feet. The @value='"" won't even find anything anymore if the string has already been modified.

We would need a new type of xml instruction that appends inside a value, which would use a method that converts the existing string to a list, appends the new string to it, and reconverts the list to a new string before setting it in the xml...

 

By the way, there is a small compile bug with the Neon Signs mod.

c:\SDXModding\SDX0.7.2c\Targets\7DaysToDie\Mods\Neon Signs\Scripts\BlockNeonSign.cs(42,15): error CS1501: No overload for method 'IsMyLandProtectedBlock' takes '2' arguments

ERROR: Failed to compile Mods.dll

ERROR: Task Compile mod scripts failed

Easy to fix by adding a 3rd argument to the failing method, but it's a bit weird that it fails, because when you look in dnSpy, the 3rd argument is optional.

 

Also, I'd really like some clues about why Localization doesn't work for me, does it really work on your side?

It never worked for me in all the SDX versions I tried. I have my Localization.txt file in a 'Text' folder like all other mods. And it actually doesn't work for any of the mods I downloaded, not just mine.

Link to comment
Share on other sites

Ok thanks, but this seems to still replace the whole string, right? At least that's what it looks like in NoAmmo, and from the quick tests I did.

 

I would like to be able to insert a new item in the string without specifying the whole thing, because if multiple mods add items to the same string value, they will step on each others feet. The @value='"" won't even find anything anymore if the string has already been modified.

We would need a new type of xml instruction that appends inside a value, which would use a method that converts the existing string to a list, appends the new string to it, and reconverts the list to a new string before setting it in the xml...

 

By the way, there is a small compile bug with the Neon Signs mod.

 

Easy to fix by adding a 3rd argument to the failing method, but it's a bit weird that it fails, because when you look in dnSpy, the 3rd argument is optional.

 

Also, I'd really like some clues about why Localization doesn't work for me, does it really work on your side?

It never worked for me in all the SDX versions I tried. I have my Localization.txt file in a 'Text' folder like all other mods. And it actually doesn't work for any of the mods I downloaded, not just mine.

 

I don't think we have a way of grabbing existing values, and re-using them yet. Maybe A17 will bring that support, since xpath will be more supported.

 

The Neon Signs is a Three08 mod. He's just getting back unto the scene, so we may get that tweaked.

 

Localization does work for others; Can you provide your localization file?

Link to comment
Share on other sites

Here's one of them, thanks!

 

[ATTACH]25047[/ATTACH]

 

About xpath, I thought it was developed by you guys, that's why I was thinking it could be easy to add. ;)

 

Take a look at this file. I added EnChanged for the "Changes" tab. I also removed the empty languages, which SDX will allow you to do.

 

The first line in the localization file is important. Whatever columns you add there, follow the same pattern with the rest of the file. SDX will automatically add extra commas to fields you don't specify (Klingon, German).

 

Also, using Excel or reading the file as a CVS will make updating and managing the file a lot easier.

 

 

HAL9000 does the dev work for it. He was not the original author, however, and the xpath implementation is incomplete. A17 is supposedly to include xpath support natively. We are hoping that will fill in what SDX can't do easily now.

 

Once we see A17, we'll know what new features to add for SDX, as we don't want to duplicate work. The less SDX has to do, the more stable it becomes.

Localization.txt

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...