Malacath

[Tutorial] Creating a "handslot-equippable-item" from scratch

Recommended Posts

simplex    2,608

@Malacath

Great tutorial! I just didn't get the "colour" parameter for the sample prefab's "fn". It receives TheSim as its parameter (though I don't think that's ever used, since TheSim is a globla variable; usually the fn() is defined as taking no arguments).

Share this post


Link to post
Share on other sites
Malacath    121

@Malacath

Great tutorial! I just didn't get the "colour" parameter for the sample prefab's "fn". It receives TheSim as its parameter (though I don't think that's ever used, since TheSim is a globla variable; usually the fn() is defined as taking no arguments).

*cough* *cough* what are you talking about *cough*

No, srsly, thanks for pointing that out. It was the last (I hope) leftover of the code for the staffs. Since I never used the argument I simply didn't really care. They usually get the colour to specify the animations that are being used.

  • Like 1

Share this post


Link to post
Share on other sites
Rosten    913

*cough* *cough* what are you talking about *cough*

No, srsly, thanks for pointing that out. It was the last (I hope) leftover of the code for the staffs. Since I never used the argument I simply didn't really care. They usually get the colour to specify the animations that are being used.

There's a small problem i noticed (this may be just me messing up and not a problem in your guide) but, whenever you try to run the game as you said to to test the mod, it doesn't work because of the lack the .tex and .xml files for your item, and it doesn't really say how or where to get these files

 

Note - Even in the finished example, the wand.lua calls for wand.xml and wand.tex, so when i run it it brings up an error because all that's there is wand.png

Edited by Blazingice26

Share this post


Link to post
Share on other sites
seronis    130

xml files are text files.  Open up one of the other textures xml file to see what needs inside the one for your wand.tex.   To generate your wand.tex  (which a texture, not text) you need to convert your png image.  simplex has a tool published to do this called ktech.  It should be in the forum downloads

Share this post


Link to post
Share on other sites
Rosten    913

xml files are text files.  Open up one of the other textures xml file to see what needs inside the one for your wand.tex.   To generate your wand.tex  (which a texture, not text) you need to convert your png image.  simplex has a tool published to do this called ktech.  It should be in the forum downloads

Thanks, i couldn't find a good xml converter and i didn't really have an idea of what a xml file actually was, thanks for pointing me in the right direction

Share this post


Link to post
Share on other sites
Malacath    121

To clear this up, the crucial part here is, that this tutorial is for people who fulfill one of the two conditions:

1) They work on Windows

2) They know someone who works on Windows

Ass soon as the Tools are ported this is no longer the case and anyone can follow it.

So if you are on Windows you need to download the "Don't Starve Mod Tools" from Steam which automize the steps you are missing. In that regard this tutorial is complete because the DSMT are mentioned as a requirement for the tutorial.

Share this post


Link to post
Share on other sites
Rosten    913

Edit -- Re-added 

So, i followed all the steps and substituted all the stuff and made the xml and tex files, but whenever  i try to run the mod don't starve just crashes, can someone look at this for me and make sure everythings in order?

(note "friendstaff" is the prefab name) WilsonsFriendWand(Mediafire) (are we allowed to use mediafire links here? it won't let me attach the .rar file to the attachments) I need this fixed as soon as possible because its a bit hard to make a mod without being able to test whether it works or not :/

Edited by Blazingice26

Share this post


Link to post
Share on other sites
Malacath    121

Edit -- Im gonna move this over to my thread so it doesn't clog up yours

Well, if it's related to this tutorial I would actually prefer if you keep it here (additionally to your own thread if you want it there) so in the event that others have a similiar problem they will get the answer here.

Share this post


Link to post
Share on other sites
Rosten    913

Well, if it's related to this tutorial I would actually prefer if you keep it here (additionally to your own thread if you want it there) so in the event that others have a similiar problem they will get the answer here.

I think it may bthe .xml files, i can't find a good converter for png -> .xml so i had to convert the png into a .doc and rename it to .xml, since i figured they were pretty much the same file, but feel free to test it and see if its working for you and its just something on my side, although i do think you should include something for converting png to .tex and .xml since the script you give for the "myitem.lua" directly calls for both myitem.tex and myitem.xml and won't work without both in good order.

Edited by Blazingice26

Share this post


Link to post
Share on other sites
Malacath    121

I think it may bthe .xml files, i can't find a good converter for png -> .xml so i had to convert the png into a .doc and rename it to .xml, since i figured they were pretty much the same file, but feel free to test it and see if its working for you and its just something on my side, although i do think you should include something for converting png to .tex and .xml since the script you give for the "myitem.lua" directly calls for both myitem.tex and myitem.xml and won't work without both in good order.

First off, seronis already told you that *.xml is not an image format, it's a text file. Every image in the *.tex format has an *.xml file besides it that looks like this

<Atlas>    <Texture filename="myitem.tex" />    <Elements>        <Element name="myitem.tex" u1="0" u2="1" v1="0" v2="1" />    </Elements></Atlas>

Where "myitem.tex" is in the same folder as "myitem.xml"

So if you are on Windows you have to download "Don't Starve Mod Tools" from Steam which will automatically create these files if you put the "myitem.png" in the right position, that is the "images" folder in your modfolder.

If you are on Linux or Mac you will have to use ktech to convert the *.png file to a *.tex file and write the *.xml yourself according to the template above.

 

All of this is mentioned in the tutorial except for the template. I will edit it hough so it contains a basic guide for how to do it.

 

So getting back to specifically you: Are you on Windows or not?

Edited by Malacath

Share this post


Link to post
Share on other sites
Rosten    913

First off, seronis already told you that *.xml is not an image format, it's a text file. Every image in the *.tex format has an *.xml file besides it that looks like this

<Atlas>    <Texture filename="myitem.tex" />    <Elements>        <Element name="myitem.tex" u1="0" u2="1" v1="0" v2="1" />    </Elements></Atlas>

Where "myitem.tex" is in the same folder as "myitem.xml"

So if you are on Windows you have to download "Don't Starve Mod Tools" from Steam which will automatically create these files if you put the "myitem.png" in the right position, that is the "images" folder in your modfolder.

If you are on Linux or Mac you will have to use ktech to convert the *.png file to a *.tex file and write the *.xml yourself according to the template above.

 

All of this is mentioned in the tutorial except for the template. I will edit it hough so it contains a basic guide for how to do it.

 

So getting back to specifically you: Are you on Windows or not?

Windows, 8 Specifically 

Share this post


Link to post
Share on other sites
Malacath    121

Windows, 8 Specifically 

Perfect, I uploaded the OP with a screenshot where you can find the dropdownmenu to "Tools" on Steam. This is where you can find the "Don't Starve Mod Tools" which should make the tutorial work again  ; )

Share this post


Link to post
Share on other sites
Rosten    913

Perfect, I uploaded the OP with a screenshot where you can find the dropdownmenu to "Tools" on Steam. This is where you can find the "Don't Starve Mod Tools" which should make the tutorial work again  ; )

Is there anyway to get it for the standalone version? or can you only get it on steam if you have don't starve? (on steam)

Share this post


Link to post
Share on other sites
Malacath    121

Is there anyway to get it for the standalone version? or can you only get it on steam if you have don't starve? (on steam)

Oh my god, that's a good question. You can definately install Steam and download the Tools for free, if I'm not mistaken you can even download Don't Starve from Steam if you have the standalone, no promises though.

 

@Cheerio If Blazingice26 has the standalone version and the Mod Tools from Steam will they interplay or will it only work with the Steam version?

Share this post


Link to post
Share on other sites
Cheerio    2,676

Basically everytime the game starts it looks for the tools so you could download them and then put them in the parent folder of the game and it should work.  The name of the game folder isn't important but the name of the mod tools folder is really important.  Your folders should look like this:

 

/my_programs

    /dont_starve

    /Don't Starve Mod Tools

  • Like 3

Share this post


Link to post
Share on other sites
Malacath    121

Is there anyway to get it for the standalone version? or can you only get it on steam if you have don't starve? (on steam)

See post above this. You'll have to download them from Steam for free and do what Cheerio said and you're fine.

Share this post


Link to post
Share on other sites
Rosten    913

Basically everytime the game starts it looks for the tools so you could download them and then put them in the parent folder of the game and it should work.  The name of the game folder isn't important but the name of the mod tools folder is really important.  Your folders should look like this:

 

/my_programs

    /dont_starve

    /Don't Starve Mod Tools

How can i get the dont starve mod tools without having don't starve on steam? the mod tools aren't on the list of tools i can download If i have to have steam then thats no problem, i can just earn some money raking up the ridiculous amount of leaves on front of our house and buy a key off the humble shop Until then, if someone can use the tools to make the files in the assets folder xml then that would be great since i wont be doing my own art until the coding is complete

 

Sorry i haven't been answering, i've been up all night working on stuff all weekend and completely crashed today

Edited by Blazingice26

Share this post


Link to post
Share on other sites
Cheerio    2,676

How can i get the dont starve mod tools without having don't starve on steam? the mod tools aren't on the list of tools i can download If i have to have steam then thats no problem, i can just earn some money raking up the ridiculous amount of leaves on front of our house and buy a key off the humble shop Until then, if someone can use the tools to make the files in the assets folder xml then that would be great since i wont be doing my own art until the coding is complete

 

Sorry i haven't been answering, i've been up all night working on stuff all weekend and completely crashed today

Try this link:

 

https://github.com/kleientertainment/ds_mod_tools_win32

Share this post


Link to post
Share on other sites
Soopakoopa    72

Ok, so I was working on this new weapon mod. I felt the weapon needed to be bigger so I set

up a topic asking how to do that. I was directed here, and I followed the tutorial, but the weapon

is now invisible, swap, ground animation, inventory icon and all. Any idea what's wrong with it?

 

 

 

 

A broken mod.zip

Share this post


Link to post
Share on other sites
Malacath    121

Ok, so I was working on this new weapon mod. I felt the weapon needed to be bigger so I set

up a topic asking how to do that. I was directed here, and I followed the tutorial, but the weapon

is now invisible, swap, ground animation, inventory icon and all. Any idea what's wrong with it?

You're supposed to put the image "swap_logclub.png" into another subfolder called "swap_logclub" as well, this way you create the symbol.

Then you completely skipped the part of naming all things inside Spriter correctly. "entity_000" should be "swap_logclub" and "NewAnimation" is supposed to be named "BUILD". Read the guide again for more information.

Next you didn't change the code to swap the right build. Neither did you change the build and bank of your animations for the object.

So really, read the guide and do the things written there, otherwise it can't work  : P

Share this post


Link to post
Share on other sites
Soopakoopa    72

Ah, ok. And about not renaming the entities, well, I guess I forgot to on the 15th consecutive try to get it working.

But ok, thanks.

 

EDIT: I did that, and checked, and the animation zips were there, but it was still all invisible in-game.

I checked and the atlas images all had the proper sprite, but everything is still invisible. I can't find anything

in the scripting which would cause everything to be invisible either.

Edited by Soopakoopa

Share this post


Link to post
Share on other sites
Malacath    121

Ah, ok. And about not renaming the entities, well, I guess I forgot to on the 15th consecutive try to get it working.

But ok, thanks.

 

EDIT: I did that, and checked, and the animation zips were there, but it was still all invisible in-game.

I checked and the atlas images all had the proper sprite, but everything is still invisible. I can't find anything

in the scripting which would cause everything to be invisible either.

Upload the mod again.

Share this post


Link to post
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