News:

SMFNew Installed

+-+-

User+-

Welcome, Guest.
Please login or register.
 
 
 

Login with your social network

Forgot your password?

Site Stats+-

Members
Total Members: 728
Latest: Cho
New This Month: 0
New This Week: 0
New Today: 0
Stats
Total Posts: 10932
Total Topics: 795
Most Online Today: 389
Most Online Ever: 854
(September 18, 2024, 07:49:37 am)
Users Online
Members: 0
Guests: 111
Total: 111

Author Topic: [Tool] Item Unit file maker Script  (Read 15031 times)

0 Members and 47 Guests are viewing this topic.

[Tool] Item Unit file maker Script
« on: »
Request Fullfilled  :D
Ok. I think I took care of everything.  I wrote a bunch of tests to catch errors. And then tested a bit.

Binaries for windows 7+ and osx available here:

https://github.com/RobJames-Texas/TL2_ItemDatMaker/releases

I added functionality so that you should be able to drag and drop your mesh file from your mod folder onto the exe and it should then ask you for the rest of the parameters.

Let me know if you have any issues.

Here I'll make a rundown of what the script should do:

Given a 3d model as input, that means the file name and folder location, the scritp should generate a corresponding item unit file in a specific folder.

Example:
Input: D:\Steam\SteamApps\common\Torchlight II\MODS\ITEM_MOD\MEDIA\MODELS\WEAPONS\_SWORDS\Sword_model_01

Unit file:
Created in:  D:\Steam\SteamApps\common\Torchlight II\MODS\ITEM_MOD\MEDIA\UNITS\ITEMS\SWORDS\
Code: [Select]
[UNIT]
        <STRING>RESOURCEDIRECTORY:media/models/weapons/_Swords
<STRING>MESHFILE:Sword_model_01
[/UNIT]

List of folders equivalencies
Spoiler (hover to show)

Now, this file is totally imcomplete, it needs some basic things, a name, a unittype and a base file. But this things are related to one variable, rarity.

So a second input should be item rarity, the options being, Normal, Magic (Blue), Unique and Legendary. With this we can determine the base file and the unittype of the item. The type of item, that being an sword, axe, greataxe, etc, should be determined using the folder in which the model is stored.

Example:
Rarity input: Magic
Unit file:
Code: [Select]
[UNIT]
        <STRING>BASEFILE:media\units\items\swords\base_sword_magic.dat
<STRING>UNITTYPE:MAGIC 1HSWORD
[/UNIT]

List of folder name and base file equivalency
Spoiler (hover to show)

List of folder name and unittype equivalencies
Spoiler (hover to show)

Exception, there is no _legendary base file, they use the unique base file.

Now for the name, the name should follow the vanilla convention with a tag added. the tag should be another input. ([itemtype]_[TAG][Rarityletter][Number])

Example:
Input tag: TEST

Unit file:
Code: [Select]
[UNIT]
<STRING>NAME:sword_TESTm01
[/UNIT]

Now the last input should be item level, but to make the script have extra option, it should have 2 funtions:
Make Alternative clones, creates two more files using the first as base increasing its level by a predefined amount
Make NG+ Clones, this one should be one of the more interesting function. It would make clones of the item increasing their level simulating the NG+ calculation of GUTS for increasing level.

Example:

Input item level: 15
Make Alt Clones [Y/N]: Y

Unit file:
Code: [Select]
[UNIT]
<INTEGER>LEVEL:15
<INTEGER>MINLEVEL:13
<INTEGER>MAXLEVEL:19
[/UNIT]

Alternative Clones:
B:
Code: [Select]
[UNIT]
        <STRING>NAME:sword_TESTm01b
<STRING>BASEFILE:media\units\items\swords\sword_TESTm01.dat
<INTEGER>LEVEL:19
        <INTEGER>MINLEVEL:17
<INTEGER>MAXLEVEL:22
[/UNIT]

C
Code: [Select]
[UNIT]
        <STRING>NAME:sword_TESTm01C
<STRING>BASEFILE:media\units\items\swords\sword_TESTm01.dat
<INTEGER>LEVEL:23
        <INTEGER>MINLEVEL:21
<INTEGER>MAXLEVEL:26
[/UNIT]

The MINLEVEL should be LEVEL-2, and MAXLEVEL = LEVEL + 3. The increase in level for the alternatives should be LEVEL+4.

Now how should the "Make NG+ Clones" work, the clones should have a level increase using the equation:

For Item level in the NG range (default 0<i-level<=50)

NG+ Clone (default range : 51 to 80)
I-LevelNG+= 51+[(i-level/50) * (80-51)]

NG++ clone (default range : 81 to 100)
I-levelNG+2 = 81+[(i-level/50) * (100-81)]

NG+++ Clone (default range : 101 to 120)
I-levelNG+3 = 105

For item level in the NG+ range (default 51<=i-level<=80)

NG++ clone (default range : 81 to 100)
I-levelNG+2 = 81+{[(i-level-50)/(80-50)] * (100-81)}

NG+++ Clone (default range : 101 to 120)
I-levelNG+3 = 105

For item level in the NG++ range (default 81<=i-level<=100)
NG+++ Clone (default range : 101 to 120)
I-levelNG+3 = 105

This option should be able to interact with "make alternative clones" in a way that every alteranative clone, get their corresponging NG+ clones.

Example:

Input item level: 15
Make Alt Clones [Y/N]: N
Make NG+ Clones [Y/N]: Y

Unit file:
Code: [Select]
[UNIT]
<INTEGER>LEVEL:15
<INTEGER>MINLEVEL:13
<INTEGER>MAXLEVEL:19
[/UNIT]

NG+ Clones:
NG+
Code: [Select]
[UNIT]
        <STRING>NAME:sword_TESTm01NG+
<STRING>BASEFILE:media\units\items\swords\sword_TESTm01.dat
<INTEGER>LEVEL:60
        <INTEGER>MINLEVEL:58
<INTEGER>MAXLEVEL:63
[/UNIT]

NG+2
Code: [Select]
[UNIT]
        <STRING>NAME:sword_TESTm01NG+2
<STRING>BASEFILE:media\units\items\swords\sword_TESTm01.dat
<INTEGER>LEVEL:87
        <INTEGER>MINLEVEL:85
<INTEGER>MAXLEVEL:90
[/UNIT]

NG+3 (exception in Minlevel and Maxlevel, also has level_requiered:101 added.)
Code: [Select]
[UNIT]
        <STRING>NAME:sword_TESTm01NG+3
<STRING>BASEFILE:media\units\items\swords\sword_TESTm01.dat
<INTEGER>LEVEL:105
        <INTEGER>MINLEVEL:99
<INTEGER>MAXLEVEL:999
<INTEGER>LEVEL_REQUIRED:101
[/UNIT]

TL;DR:
Spoiler (hover to show)
« Last Edit: October 23, 2018, 06:50:18 am by Anarch16sync »

Share on Bluesky Share on Facebook


Re: [REQUEST] Item Unit file maker Script
« Reply #1 on: »
---Reserved ----

Re: [REQUEST] Item Unit file maker Script
« Reply #2 on: »
Great write-up. That sounds fairly reasonable to implement.

Re: [REQUEST] Item Unit file maker Script
« Reply #3 on: »
Added how the Make NG+ clones should work part.

Re: [REQUEST] Item Unit file maker Script
« Reply #4 on: »
Not completed, but I got a good start on it.

https://github.com/RobJames-Texas/TL2_ItemDatMaker

Once it's further along I'll post a binary somewhere.

I can write some code to generate the guids as well. 

I noticed the legendary items do something a little different with the name.

   <STRING>NAME:legendary_greataxe01

instead of

   <STRING>NAME:greataxe_u01

so that will need fixed.
« Last Edit: April 21, 2018, 04:21:30 pm by Vkoslak »

Re: [REQUEST] Item Unit file maker Script
« Reply #5 on: »
okay not fully sure how to interpret you guys' progress, so i'll just yell "go,go,GO!" from the sidelines! :D


Re: [REQUEST] Item Unit file maker Script
« Reply #6 on: »
I was out of town for a couple of weeks.  I can get back on this now.

Re: [REQUEST] Item Unit file maker Script
« Reply #7 on: »
Ok. I think I took care of everything.  I wrote a bunch of tests to catch errors. And then tested a bit.

Binaries for windows 7+ and osx available here:

https://github.com/RobJames-Texas/TL2_ItemDatMaker/releases

I added functionality so that you should be able to drag and drop your mesh file from your mod folder onto the exe and it should then ask you for the rest of the parameters.

Let me know if you have any issues.
« Last Edit: April 21, 2018, 04:21:17 pm by Vkoslak »

Re: [REQUEST] Item Unit file maker Script
« Reply #8 on: »
Ok. I think I took care of everything.  *...snip...*

Sweet man! This will help so many of us out so much! Does this board have kudos ;P

Re: [REQUEST] Item Unit file maker Script
« Reply #9 on: »
Awesome work @Vkoslak, I just tested this with some models I had laying around,I found some issues: the way the files are coded, for some reason, GUTS won't read them, I checked and they are saved in UNIX format, (I use windows 7 x86, not a big deal it takes seconds to change, and I'm not even sure Guts notice the difference), and  are encoded in UTF-8 without Bom, when the files GUTS use seems to be in UCS-2 Little Endian ( Guts won't handle this, says something about guessing it's ASCII and some other things ), at leas thats what Notepad++ tells me... can that be an issue with my pc lenguage configuration or something like that, or any other thing that I need to check in my end?
 And the other one is the <STRING>MESHFILE: line, the exe writes the .mesh extension at the end of the name, if that happens guts can't find the mesh file.

Again, thanks for this, even with this issues is a great tool  :D

Re: [REQUEST] Item Unit file maker Script
« Reply #10 on: »
« Last Edit: April 21, 2018, 04:21:01 pm by Vkoslak »

Re: [REQUEST] Item Unit file maker Script
« Reply #11 on: »
Thanks @Vkoslak for the hard work!  And @Anarch16sync it's nice to hear from u again!


Re: [REQUEST] Item Unit file maker Script
« Reply #12 on: »
Ok, posting for a bump on this awesome tool. And also for a piece of advice for people using it.

Advice 1: The .dat files produced by this tool don't work right of the bat, you need to edit them to replace the "spaces"  before new lines for a "Tab", I didn't post this as a bug because is a common problem with text exporters to replace a "tap" for multiple spaces, I don't know if this is the case but It's my guess. Notepad++ has tools to do this, a "Search and replace" or "Space to Tab" both work.

Advice 2: The alternative clones and NG+ clones won't appear in GUTS to edit or in game mode, but work right in game when the mod is build, this is because the "Basefile:" line doesn't have the "mods/[mod_name]/" before the "media/..." naming of the directory, again a "Search and replace" works, or you can let this like that and edit the item files in notepad++

With that piece of advice, I recommend all people to use this awesome tool to make their items.
« Last Edit: October 23, 2018, 08:56:50 am by Anarch16sync »

Re: [Tool] Item Unit file maker Script
« Reply #13 on: »
I didn't know about the tab thing.  I can change that easy enough.  I'm sure that I put spaces in there because for my programming I always use spaces instead of tabs.

Re: [Tool] Item Unit file maker Script
« Reply #14 on: »
I didn't know about the tab thing.  I can change that easy enough.  I'm sure that I put spaces in there because for my programming I always use spaces instead of tabs.

Oh, as long as is not a big deal that would be nice. You're awesome @Vkoslak !

 

Recent Topics+-