Author Topic: My First Mod, modifying a dye kit  (Read 2379 times)

Malachor

  • Developer
  • Eldest
  • ****
  • Posts: 1996
  • Karma: 25
My First Mod, modifying a dye kit
« on: Apr 10, 2016; 09:30 AM »
After seting up Reanimator, let's do something with it, namely modifiying a dye kit, and then getting it into the game.

Before we get started, be aware that this method is for vanilla(unmodded) hellgate london, I will go over the changes needed to mod for Revival 1.5b2 afterwards.

Open Reanimator. refer to PIC1
Open ITEMS in the Table Editor, then go down to index 1042 name of Dye_Kit_Lava
refer to PIC3

Side note: In the opened tab, you'll see 2 vertical scrollbars and 1 horizontal one. The first vertical one and the horizontal one moves the section with grey and white horizontal rows. The second vertical scrollbar moves the selected row. Sometimes it's easier to use one rather than the other, I think it just boils down to personal preferences really.
Oh yeah if you click on the column title/name in the first section it arranges the rows in alphanumeric/reverse alphanumeeric order.

Now, there are a lot of things that can be changed, but we'll cover adding +100 luck, and change the colorset.
First Luck

Scroll the first section horizontally until you get to props1 column(it's about halfway across). Now you'll notice that the lava dye kit doesn't have anything in there, but other dyes a bit further down do....
Due to a limit of 4 pictures that can be attached in a post, I'm trying to consolidate information, but if it's too confusing let me know and I'll change it, somehow. Back to the topic.....
If you hover your mouse over the vertical lines between the column title/name you'll see a double arrow, that means you can change to width of the column to the left of the line. So let's make props1 wider. Some items just don't know when to quit, but we're interested in the second row from the bottom in the picture(it's actually index 1069).
Time for a picture.PIC4
Don't worry too much what the script says, we'll be changing it, but the amount of luck varies based on the item level.
Now go back to the first row(index 1042 I mean) and type into the props1 column SetStat673('luck_item_bonus', 1000);

That's it for luck, now let's change the colorset.
Scroll horizontally onwards to the right to the column named colorSet(you could scroll to the end then scroll back a little bit). Right beside it is a column named colorSet_string which will tell you what the colorSet is.

Now let's open the colorsets table. This, I think is as self explanatory as tables go, there are a total of 156 colorsets.
Dye_Kit_Lava is index 136. I don't know about you, but I just want to see what it will look like with one of the hair colorsets, say Hair 3(index 24), but you don't have to choose this one.
After you've chosen one, click on Close Tab while you've got colorsets selected to close colorsets, if any of the others are slected you'll close it instead. Then type into colorSet the one you chose. As soon as you press enter you'll notice that it automatically names it correctly in the colorSet_string column.
Now it's time to save.
Go to File -> Save, click on it, it will ask where you want it saved, so select your Reanimator\data\excel folder, after a bit of time a small window pops up saying that the files has been saved, then we can move onto part 2 Getting it into the game.

Getting your newly modified dye into the game by modifying treasure table.


Either make a note of the dye index you changed in this case it's 1042, or leave the items table open, it's up to you.
Open TREASURE
Go down to index 22 treasureClass player. now I'm going to use the right side of the Table Editor where the row is organised vertically.
You'll notice that there's several columns(arranged vertically) labeled itemX, valueX, and that item1 has 3, 23, -1, -1(many -1s follow), while value1 has 1 in it.
Side note: the first value in itemX is what the second value references. so using the example gicven, 3, 23, means choose treasureClass 23, the 1 in value1 means basically yes. What we want to do to item2 is change 0,-1 to 1,1042, which means chose index 1042 from the items file, and value2 we'll put 1 so it'll give us one of them. If you put 2 in value2 then you would get 2 of them. Another common arrangement for itemX is 2, X  and that means choose from unittype file, and if the X was 305, then it would randomly select from one of the dye kits.
Back on topic, let's put into item 2 1,1042, leave the rest of it alone, and in value2 put 1.
refer to PIC4
Save it into Reanimator\data\excel.

Now, I got you to change index 22(player) in treasure because this way it gives it to a new character. It may also change an already existing instance, say a character who already has Lava dye kit, but I'm not sure, and by doing it this way it means that you have to create a new character, so if something goes pear shaped(technical term), it's only a new character who gets affected, not an already existing character. Hopefully.
Another side note: Black Knight, Cold Steel, Vanquish, Ivory Haze, Copper Sky, Indigo Fire, Dark Vengeance, and Earth Core dye kits are all subscriber only, so you would need to go to bitmask02(use the righthand section) in ITEMS and uncheck subscriberOnly, then save it.

Close Reanimator then double check that both items.txt.cooked and treasure.txt.cooked are in Reanimator\data\excel\
If they are, double click Hellpack.exe. Hellpack will pack the 2 files into sp_hellgate_1337.dat/.idx files, which you then move from your Reanimator folder into your Hellgate london\Data folder, then run the game, create a new character, and check that the character has the dye, and that it works, obviously, we don't know if the +100 luck does in fact work, but it should show up on the dye, and if you changed the colorset then that will be obvious if it worked.
Refer to FinishDye
If it worked, congratulations on creating your first mod. If it didn't let me know what, where, when who, how, and I'll do what I can to help.

mcroosta

  • Nameless
  • *
  • Posts: 24
  • Karma: 0
  • For the living?
Re: My First Mod, modifying a dye kit
« Reply #1 on: Apr 11, 2016; 05:45 AM »
Thanks for making this guide, Malachor. Can you name .dat/.idx files anything you want? Do they have to have the same names as a pair? I seem to recall reading that HG:L uses the data contained in the most recently created files.

Malachor

  • Developer
  • Eldest
  • ****
  • Posts: 1996
  • Karma: 25
Re: My First Mod, modifying a dye kit
« Reply #2 on: Apr 11, 2016; 06:28 AM »
Yes, they both have to have the same name; well I'm guessing, though I think that it's a good guess, that .idx is short for index, and .dat is short for data. So if they were different the mod wouldn't work. But I have to say that I haven't tried it.

You can rename them, I don't actually know how creative the name can be though, I've always kept sp_hellgate_, though I've changed the numbers. I had thought about naming them something else, but it keeps them with the patch files, so I know where to look if I need to delete/move them.

And yes, the game uses the files that are more recent.

I also should have noted that this could be used with any other mod, but only temporarily. So you'd create the mod, move the .dat/.idx, create the new character, get them to holborn......and then what.......well I just found out that I outsmarted myself. doh!
You need the cube to be able to trade, which is fine if you're using a mod that gives you the cube, but if you're playing vanilla hellgate london, then you don't get the cube.

I can't believe I forgot that. I even mentioned that some of the dyes are subscriber only, but the cube slipped my mind.
Sounds like it's time for a new tutorial.

crash

  • Nameless
  • *
  • Posts: 12
  • Karma: 2
Re: My First Mod, modifying a dye kit
« Reply #3 on: Apr 24, 2016; 06:09 AM »
 say Hair 3(index 24), but you don't have to choose this one.
After you've chosen one, click on Close Tab while you've got colorsets selected to close colorsets, if any of the others are slected you'll close it instead. Then type into colorSet the one you chose. As soon as you press enter you'll notice that it automatically names it correctly in the colorSet_string column.

Having trouble with the wording or maybe i just don't understand..
Choose as in select or ???
Then u say "Click on close Tab", which I do not see  :-[
R. Wheeler

Malachor

  • Developer
  • Eldest
  • ****
  • Posts: 1996
  • Karma: 25
Re: My First Mod, modifying a dye kit
« Reply #4 on: Apr 27, 2016; 04:17 AM »
say Hair 3(index 24), but you don't have to choose this one.
After you've chosen one, click on Close Tab while you've got colorsets selected to close colorsets, if any of the others are slected you'll close it instead. Then type into colorSet the one you chose. As soon as you press enter you'll notice that it automatically names it correctly in the colorSet_string column.

Having trouble with the wording or maybe i just don't understand..
Choose as in select or ???
Then u say "Click on close Tab", which I do not see  :-[
Choose, as in make a choice as to which colorset you want to use.
Close Tab: When you look at the table editor, beneath the list of files(bottom left of the table editor), there's 2 buttons; Reload, and Close Tab.

crash

  • Nameless
  • *
  • Posts: 12
  • Karma: 2
Re: My First Mod, modifying a dye kit
« Reply #5 on: Apr 27, 2016; 05:08 PM »
Thank you...I was using OLD reanimator....
Tried it with the new......
Got it to work but doesn't show up in game...
I will keep trying....
Any hints/help would be appreciated
R. Wheeler

neosildrake

  • Nameless
  • *
  • Posts: 6
  • Karma: 0
Re: My First Mod, modifying a dye kit
« Reply #6 on: Apr 23, 2017; 02:46 PM »
Thanks for the post, but I have some questions.

1. The: SetStat673('luck_item_bonus', 1000), There are similar  (smaller) boni on other items, but the reference is much longer with (Sunit....blablabla). Is this not important? 
2. If I want to modify an Item for maximal resistance to elemental attacks aka elemental immunity, what do I have to enter?
3. What is the maximum bonus number I can enter?
4. Some columns have headers for attack, defense, shield, armor and even luck. Can I not simply enter the desired amount there?
5. I now have Revival SP 2.31 installed. Does this tutorial work for it too?
« Last Edit: Apr 23, 2017; 03:18 PM by neosildrake »

Malachor

  • Developer
  • Eldest
  • ****
  • Posts: 1996
  • Karma: 25
Re: My First Mod, modifying a dye kit
« Reply #7 on: Apr 23, 2017; 11:37 PM »
1. Something like this? SetStat673('luck_item_bonus', 10 * $unit->GetStat666('level') + 2);
Well, what I chose means that it will stay that value, the example I've just copy/pasted modifies the value based on the character's level. Is that important? That's up to whoever does the changes.
2. You could modify this: SetStat673('sfx_defense_bonus', 'all', 20 * item_level_sfx_defense($unit->GetStat666('level')) / 100); This gives a bonus to all sfx defence types. It references the table ItemLevels, for the sfxDefenseAbility entry equal to the character's level. For example if your character's level is 16, the sfxDefenseAbility is 100, so it would be calculated like: 20 * 100 / 100 and equal 20, at 50th level it would be 20 * 270 / 100 = 54.
3. The maximum? That's tricky. In the Stats table sfx_defense_ability has a valBits of 24, which translates to about 16,000,000, but whether the game has other checks in place to prevent it going that high, I don't know, I've never tried to modify it. Also different stats have different maximums.
4. Well, you could do that and see what happens. I mean as you've probably already seen, armour and shields do that for the armor and shield values, so it might work the same with dyes. But what won't is the calculation based on any other stats, like the example in point 2. You will only be able to have a fixed value in those columns.
5. It should work with any mod or vanilla, patched hgl. Though, obviously you will have to use the mod's items file.

neosildrake

  • Nameless
  • *
  • Posts: 6
  • Karma: 0
Re: My First Mod, modifying a dye kit
« Reply #8 on: Apr 24, 2017; 06:17 PM »
Thank you for the answer. I have found another problem.
I cannot save or export the Item file from the Reanimator window to the designated folder.
I cannot save (nothing happens) the treasure file either. I can only export the file to the data\excel folder.
This is the error message I get when I try to export "ITEM"



My PC runs on Win7 64 home edition.

Kikina the templar

  • Named
  • **
  • Posts: 112
  • Karma: 4
Re: My First Mod, modifying a dye kit
« Reply #9 on: Apr 24, 2017; 08:06 PM »
Yes, "items" table from revival 2.3 cannot be edited with Reanimator.
If you want make here some changes, you must done it directly in text file into mod zip archive ..

neosildrake

  • Nameless
  • *
  • Posts: 6
  • Karma: 0
Re: My First Mod, modifying a dye kit
« Reply #10 on: Apr 24, 2017; 09:26 PM »
That sucks. Any comprehensible faq that shows how to directly mod the item.txt file in 2.3?
When I open the document it is really not very "user friendly".
What revival version is the last one the Item file could be changed with Reanimator?

Kikina the templar

  • Named
  • **
  • Posts: 112
  • Karma: 4
Re: My First Mod, modifying a dye kit
« Reply #11 on: Apr 24, 2017; 11:50 PM »
I dont know, if are this file editable in Revival 1.2.1. But from version 1.5b to un 2.3 is not editable in ALL versions.
I made all the changes for un revival with text and hexa editor.
Errors into reanimator are causing by badly entered parameters with a lot of items (mainly equip from Abyss and Stonehenge).
I do not know about any simple way of editing this file, sorry..    :-\

neosildrake

  • Nameless
  • *
  • Posts: 6
  • Karma: 0
Re: My First Mod, modifying a dye kit
« Reply #12 on: Apr 26, 2017; 06:35 PM »
I can use a hex editor. Have H+D hexeditor at the moment. The problem comes with knowing or rather not knowing the code for the items. F.e. what hexcode does a dye have or an implant or a ring and/or in what row do I find them. Is there maybe a list somewhere?

I'd like to have a bit more Palladium to experiment with the Augmentrex. Random Augentation sucks.

What text editor do you use and how do you find anything amidst the humunous pile of numbers and so on. And if you found the right "-1" or "0" to modify, what do you put in?

Malachor

  • Developer
  • Eldest
  • ****
  • Posts: 1996
  • Karma: 25
Re: My First Mod, modifying a dye kit
« Reply #13 on: Apr 26, 2017; 11:11 PM »
Use Reanimtor as a reference, since it shows the code in a readable(sort of) format.
So you look through Items for an entry that has the property you want, or look through Affixes. Once you find it, then refer to the same entry in the exported text file.
As an example, using sfx defence, looking at Affixes I found entry 466: TotalDefense1 which has: SetStat673('sfx_defense_bonus', 'all', rand(@game4, 55, 70) * item_level_sfx_defense($unit->GetStat666('level')) / 100);, then I look in the Affixes.txt file. go to line 468, or search for TotalDefense1, copy: "710,26,55,26,70,3,33,707,0,714,666,0,3,191,358,26,100,369,673,528482304,0" then open Items.txt.
Find Dye_Kit_Sub_Black_Knight. This is to show you where to paste the previous code(the "710 etc). It has code that starts with "707, etc so highlight from that point back to the first -1 you get to. You should have a selection of 155. That's the point where you paste the code into another dye kit. Where you started the selection, not where you finished it. If you go past that -1 for 155 bytes then paste the code, sorry, I'm a little pressed for time at the moment, otherwise I'd post a screenshot.
Now that we've got that code pasted in let's change it. So what do we change? 55, 70, maybe 100. As we can tell from Reanimator's version it randomly chooses a value from 55 to 70 then multiplies that by the character's level, then divides that by 100. At level 2 the character might have 2 or 3, at 50th up to 350. The game can definitely handle 4000, so I would start by changing 100 to 1 to get 55 to 70 multiplied by level up to 3500. make 55 550, 70 700, and see what happens.
I hope this helps.

33901

  • Nameless
  • *
  • Posts: 1
  • Karma: 0
Re: My First Mod, modifying a dye kit
« Reply #14 on: Jun 18, 2017; 10:18 AM »
Hi, sorry for bringing this thread back to life again. I tried the exact steps in this guide, and managed to create both sp_hellgate_1337.dat/.idx files. However, when I start the game, and create a new character, the new item is not in the backpack. May I know what could be the problem? Thanks!