I DID IT! I added a new token!

This is the place to discuss all issues relating to the manipulation of graphics/animations, sounds, music and cinematics within Diablo 2.

Moderators: Nefarius, Necrolis

User avatar
Nefarius
Retired Admin
Cherub
Posts: 11607
Joined: Sat Jun 15, 2002 8:13 pm
Location: Where the blood forever rains
Contact:

Hand-picked

I DID IT! I added a new token!

Post by Nefarius » Wed Jan 29, 2003 3:46 pm

From that small discussion I started some wile back, I started testing if this is possible AND IT IS!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! (sry)

:jump:

This means INFINITE amounts of new animations per mod! (well nearly as theres a limited amount of possibilites from 00-ZZ)
It requires no code editing at all as it seams, no side effects by now.

Ill write down the steps I took:

1. find a code that isnt use, I used FU,
2. create a new animation and new cof files for that token,
3. adjust montype.txt
4. add the new token data to animdata.d2


[strike]*P.S. the only part that will require some code editing is to apply a palshift to the token, as there is some internal table that tells the game which token has a palshift.dat file.[/strike]

I managed to add palshift to them now as well, this kind of shows that table simply tells the game what token DOSENT have a palshift ratter then which has a palshift :)

=done :)
Thats all that was needed.

*after im gonna cool down a bit ill explain it in more detail. :mrgreenparty:

nother edit: im gonna convert over all the d1 and hellfire monsters now that I dont need to replace anything for this :)
Last edited by Nefarius on Fri Feb 28, 2003 2:36 am, edited 7 times in total.
''(...) The game can basically be considered unhackable. '' - Blizzard Entertainment (30th May 2000)
Black Omen Productions | MetalStorm: Progress Report | Screenshots

User avatar
Alkalund
Retired Admin
Throne
Posts: 7597
Joined: Sun May 26, 2002 5:54 pm
Location: Toronto, Ontario, Canada
Contact:

Hand-picked

Re: I DID IT! I added a new token!

Post by Alkalund » Wed Jan 29, 2003 4:39 pm

Hmm sounds simple enough :) I´m definitely interested in more information on this one after you cool down ;)

User avatar
Paul Siramy
Retired staff
Principality
Posts: 2828
Joined: Sat May 25, 2002 2:39 pm
Location: La Garenne Colombes (near Paris)
Contact:

Hand-picked

Re: I DID IT! I added a new token!

Post by Paul Siramy » Wed Jan 29, 2003 4:39 pm

I tough monstats.txt had a fixed amount of lines ? I see no reference about that file in the preview of the method you're using, but if you say it's working, then it's really sweet indeed :)

User avatar
Alkalund
Retired Admin
Throne
Posts: 7597
Joined: Sun May 26, 2002 5:54 pm
Location: Toronto, Ontario, Canada
Contact:

Hand-picked

Re: I DID IT! I added a new token!

Post by Alkalund » Wed Jan 29, 2003 4:48 pm

Well monstats does have a fixed row number. So, you might be able to add new tokens, but the amount of different monsters you can have in monstats.txt is still the same. That will change in 1.10 from what I know, you will be able to add new rows to monstats.txt (up to a 4096 limit probably, but that´s a start).
For now, you can take advantage of the fact that each token is used by about 4-5 different monsters :)

User avatar
Nefarius
Retired Admin
Cherub
Posts: 11607
Joined: Sat Jun 15, 2002 8:13 pm
Location: Where the blood forever rains
Contact:

Hand-picked

Re: I DID IT! I added a new token!

Post by Nefarius » Wed Jan 29, 2003 4:48 pm

not monsters.txt, Im not speaking about new monster lines but new monster graphics without replacing an existing monster.

Until now if you lets say wanted to add the "hidden" you would have had to remove an existing token (gfx ID), but no longer, you can add endless amounts of new animations w/o removing any existing one.
''(...) The game can basically be considered unhackable. '' - Blizzard Entertainment (30th May 2000)
Black Omen Productions | MetalStorm: Progress Report | Screenshots

User avatar
Nefarius
Retired Admin
Cherub
Posts: 11607
Joined: Sat Jun 15, 2002 8:13 pm
Location: Where the blood forever rains
Contact:

Hand-picked

Re: I DID IT! I added a new token!

Post by Nefarius » Wed Jan 29, 2003 7:02 pm

This is just a more complete description of how to add a new token to the game: First off start by creating 6 new animations (we will use the ghosts AI as our new token wont have a special AI), the animations I used were: DT, NU, WL, GH, A1, DD

(which if you check, match the modes required for the ghosts AI, remember we have NO limitations when addint new tokens, so you could just give them ALL existing modes and make them work with every AI)

I have choosen the ghosts due to their simply AI, (chance to approach, chance to attack & delay) I added the new animations to their own folder (DATA\GLOBAL\MONSTERS\FU\TR\*.dcc), Added the COF files (Edited versions for the SP??HTH.COF files) (as those have 1 layer and are kind of my fav cofs to edit, as they dont require much editing time), added them as FU??HTH.COF to the FU\COF folder.

Next I didnt need to check the cmncod_a#.d2 files since its a NEW token, it wont be in there.

Finally I added the new entries into AnimData.d2 (using the animdata_edit tool to rehash animdata.d2), after I added the entries for FUA1HTH, FUDDHTH, FUDTHTH, FUNUHTH, FUGHHTH and FUWLHTH, I opened montype.txt and changed the token for the gorgon rows from GO to FU. Next I opened monstats.txt and changed the (PALSHIFT)CODE column (labeled as CODE only) to FU (originally I forgot to change it and hence thought my palshifts dont work :P) after changing this the game also used my new palshift file and thats that! a new token has been created!
Last edited by Nefarius on Wed Jan 29, 2003 8:31 pm, edited 1 time in total.
''(...) The game can basically be considered unhackable. '' - Blizzard Entertainment (30th May 2000)
Black Omen Productions | MetalStorm: Progress Report | Screenshots

User avatar
Olorin
Forum Regular
Angel
Posts: 512
Joined: Sun May 26, 2002 4:48 pm
Location: Gardens of Lórien, Valinor
Contact:

Re: I DID IT! I added a new token!

Post by Olorin » Wed Jan 29, 2003 7:17 pm

So, when 1.10 comes out and we can add more to monstats.txt, then infinite... 8-O


Nef, you have REALLY outdone yourself. Again. :twisted:
Now stop working os hard and let other people share the glory. ;) :) :mrgreen:
"For I am Olorin! And Olorin means me!"
"For I also am a steward. Did /you not know?"

User avatar
Joel
Retired staff
Dominion
Posts: 6921
Joined: Mon May 27, 2002 7:19 am
Location: Orsay
Contact:

Hand-picked

Re: I DID IT! I added a new token!

Post by Joel » Wed Jan 29, 2003 8:28 pm

Nice work!!!
Maybe a way to decrease my number of files per difficulty :)
"How much suffering, mortal, does it take before you lose your grace?"
Shadow Empire (coming soon) | forum

User avatar
Nefarius
Retired Admin
Cherub
Posts: 11607
Joined: Sat Jun 15, 2002 8:13 pm
Location: Where the blood forever rains
Contact:

Hand-picked

Re: I DID IT! I added a new token!

Post by Nefarius » Wed Jan 29, 2003 8:30 pm

Now all that is left to do is find the monster sound table in d2client.dll, then monster editing will be as advanced as missile editing already is.
''(...) The game can basically be considered unhackable. '' - Blizzard Entertainment (30th May 2000)
Black Omen Productions | MetalStorm: Progress Report | Screenshots

User avatar
Nefarius
Retired Admin
Cherub
Posts: 11607
Joined: Sat Jun 15, 2002 8:13 pm
Location: Where the blood forever rains
Contact:

Hand-picked

Re: I DID IT! I added a new token!

Post by Nefarius » Wed Jan 29, 2003 9:25 pm

Just finished adding my new ethereal teleporting hidden :) they work just fine not even a single glitch so far :).

I might release the *new token monster* as a plugin after I publish the mod :)
''(...) The game can basically be considered unhackable. '' - Blizzard Entertainment (30th May 2000)
Black Omen Productions | MetalStorm: Progress Report | Screenshots

User avatar
Olorin
Forum Regular
Angel
Posts: 512
Joined: Sun May 26, 2002 4:48 pm
Location: Gardens of Lórien, Valinor
Contact:

Re: I DID IT! I added a new token!

Post by Olorin » Wed Jan 29, 2003 11:19 pm

New dlls...new tokens...new everything...*remembers the days when EVERYTHING was irrevocably hardocded :) :) :) *

Anything's possilbe. Thank you, Code Gods! :mrgreen:

*Sacrifices a Bull :twisted: *
"For I am Olorin! And Olorin means me!"
"For I also am a steward. Did /you not know?"

User avatar
Myhrginoc
Retired Admin
Cherub
Posts: 12062
Joined: Sat May 25, 2002 7:28 am
Location: Percussion U

Hand-picked

Re: I DID IT! I added a new token!

Post by Myhrginoc » Thu Jan 30, 2003 2:19 am

Very nice work, Nefarius! Another Holy Grail of modding has been attained. You might want to add records to Monstats and Montype to see where the assertions are, perhaps the tables are expandable with a bit of code editing.
Do the right thing. It will gratify some people and astonish the rest.
~ Mark Twain
Run Diablo II in any version for mods: tutorial
The Terms of Service!! Know them, abide by them, and enjoy the forums at peace.
The Beginner's Guide v1.4: (MS Word | PDF) || Mod Running Scripts || TFW: Awakening

User avatar
Alkalund
Retired Admin
Throne
Posts: 7597
Joined: Sun May 26, 2002 5:54 pm
Location: Toronto, Ontario, Canada
Contact:

Hand-picked

Re: I DID IT! I added a new token!

Post by Alkalund » Thu Jan 30, 2003 2:43 am

[quote=Myhrginoc";p="62253"]Very nice work, Nefarius! Another Holy Grail of modding has been attained. You might want to add records to Monstats and Montype to see where the assertions are, perhaps the tables are expandable with a bit of code editing.[/quote]

LOL that's a good way of looking for code, making the game cause the error you want on purpose :mrgreen:

User avatar
Myhrginoc
Retired Admin
Cherub
Posts: 12062
Joined: Sat May 25, 2002 7:28 am
Location: Percussion U

Hand-picked

Re: I DID IT! I added a new token!

Post by Myhrginoc » Thu Jan 30, 2003 2:54 am

Blizzard went through all that trouble putting those assertions in there, why not use them? {M}
Do the right thing. It will gratify some people and astonish the rest.
~ Mark Twain
Run Diablo II in any version for mods: tutorial
The Terms of Service!! Know them, abide by them, and enjoy the forums at peace.
The Beginner's Guide v1.4: (MS Word | PDF) || Mod Running Scripts || TFW: Awakening

User avatar
Thorgrim
Posts: 71
Joined: Sat Aug 17, 2002 4:01 pm
Location: 100 Feet below the earth, in the dwarven stronghold of Karaz-a-Karak
Contact:

Re: I DID IT! I added a new token!

Post by Thorgrim » Thu Jan 30, 2003 1:00 pm

Nice work Nefarius, this will save a lot of work for my mod ;) :D
Like a well crafted mail shirt a dwarf army is, each warrior an iron-hard link, knitted together by duty,respect and loyality. And, like a mail shirt, never a blow shall pass them as long as all the links remain strong. -Durgrim Redmane, Dwarf Hammerer

The Realm of Chaos

The Forums of Chaos

Realm of Chaos Progress: 5%

User avatar
Nefarius
Retired Admin
Cherub
Posts: 11607
Joined: Sat Jun 15, 2002 8:13 pm
Location: Where the blood forever rains
Contact:

Hand-picked

Re: I DID IT! I added a new token!

Post by Nefarius » Thu Jan 30, 2003 1:34 pm

Im already in this :), im going to write down the addresses that causes the assertion and then check them out wile running the game.

*This might be the first time im not {filtered} up by assertions :P*
OMG: It DIDNT crash wile the game loaded... Now to SPAWN this new row and see what happens :?:

*After spawning it it crashed, but not due to monstats.txt, there seams to be a check that works like this: (pseudocode im reconstructing)

if (CurrentID > MaxMonsterID) {
goto Assertion;
} else {
spawn_enemy(CurrentID);
}

It dosent seams to be a file line limit, but ratter a check for max IDs...

Location : C:\Projects\Diablo2\Source\D2Common\Monsters\MonsterRand.cpp, line #3685
Expression : ptMonsterNode->nClass < NUM_MONSTERCLASS

It shows exactly what my pseudocode shows (just the expression shows a solution for the problem, aka making CurrentId lower then MaxMonsterID)

*Digging in deeper*

Fount something else of interest, close to the end of d2client.dll there is a table like structure loading the following entry at its start 7A030000, if one looks carefully this is the fallen attack sound, even this value exists 3 or 4 times in the file NONE of those looks like a table, this one however does.

*I feel that im very close to something.

Also found the skeleton sounds in there :)

ok then :) as an example

@FA928 EE060000 F5060000 00000000 00000000 0A070000...

DWord 1 = skeleton gethit
DWord 2 = skeleton death
DWord 3 = empty
DWord 4 = empty
DWord 5 = skeleton ressurrect
... there is alot more per table entry as it seams.

Each entry is very long in here, now we must find out HOW this gets allocated to monsters. then we will be able to give every monster the sounds we want.

AS it seams, these are indeed sound tables, as all their values translate to lines in sounds.txt, how ever they are NOT what actually attaches the sounds to monster events :-|

In theory there probably 3 main tables dealing with monsters, an AI table, would look like this, 5 dwords each for 1 param of the param columns from monstats.txt and probably, the second one will probably apply s1-5 (skill1 to 5) to the AIs, the third one applies overlay gfx and sounds which is probably in d2client.dll and what I found before is a part of it, or some check or something.
Last edited by Nefarius on Thu Jan 30, 2003 2:32 pm, edited 7 times in total.
''(...) The game can basically be considered unhackable. '' - Blizzard Entertainment (30th May 2000)
Black Omen Productions | MetalStorm: Progress Report | Screenshots

User avatar
Nefarius
Retired Admin
Cherub
Posts: 11607
Joined: Sat Jun 15, 2002 8:13 pm
Location: Where the blood forever rains
Contact:

Hand-picked

Re: I DID IT! I added a new token!

Post by Nefarius » Thu Jan 30, 2003 7:25 pm

Second new token added under "HU" (strangly only a few tokens end with U, like BU so this is a good place to get unused codes from) works fine :).
''(...) The game can basically be considered unhackable. '' - Blizzard Entertainment (30th May 2000)
Black Omen Productions | MetalStorm: Progress Report | Screenshots

User avatar
Vendanna
Hosted Forum Moderator
Arch-Angel
Posts: 1387
Joined: Sun Nov 24, 2002 4:55 pm
Location: Cartagena (Spain)

Re: I DID IT! I added a new token!

Post by Vendanna » Fri Jan 31, 2003 1:10 am

that means that you can put a new token in the unused "blood Knight" row containing the animations thus allowing him reappear without need to switch him with other monster?

edit: great discover Nefarius ;)
Last edited by Vendanna on Fri Jan 31, 2003 1:11 am, edited 1 time in total.
"Mysteries are revealed in the light of reason."

Black Omen's production

User avatar
Myhrginoc
Retired Admin
Cherub
Posts: 12062
Joined: Sat May 25, 2002 7:28 am
Location: Percussion U

Hand-picked

Re: I DID IT! I added a new token!

Post by Myhrginoc » Fri Jan 31, 2003 4:10 am

Nefarius" wrote:*This might be the first time im not {filtered} up by assertions :P*
OMG: It DIDNT crash wile the game loaded... Now to SPAWN this new row and see what happens :?:

*After spawning it it crashed, but not due to monstats.txt, there seams to be a check that works like this: (pseudocode im reconstructing)

if (CurrentID > MaxMonsterID) {
goto Assertion;
} else {
spawn_enemy(CurrentID);
}

It dosent seams to be a file line limit, but ratter a check for max IDs...
I think I saw that check, when I was looking at how the game loads. It isn't in the file loading routine that calls d2common.10578...that routine just loads MonType and then MonMode right on top of the other. But later on, when the token table is referenced (and it isn't in d2common.10647) there is a check of the first part of the token table against the number of records in unmodded MonType. (btw, that is same as number for MonStats.) I believe there is a similar check for MonMode tokens afterward. I'll have to find that code again next time I check.

The same logic (with different counts) is used for ObjType/ObjMode and PlrType/PlrMode token tables. But there are some hidden object codes that occur at ID=573, 580, 581 and 582, I have no idea how those are done, they are beyond the txt file limits.
Last edited by Myhrginoc on Fri Jan 31, 2003 4:12 am, edited 1 time in total.
Do the right thing. It will gratify some people and astonish the rest.
~ Mark Twain
Run Diablo II in any version for mods: tutorial
The Terms of Service!! Know them, abide by them, and enjoy the forums at peace.
The Beginner's Guide v1.4: (MS Word | PDF) || Mod Running Scripts || TFW: Awakening

User avatar
Nefarius
Retired Admin
Cherub
Posts: 11607
Joined: Sat Jun 15, 2002 8:13 pm
Location: Where the blood forever rains
Contact:

Hand-picked

Re: I DID IT! I added a new token!

Post by Nefarius » Fri Jan 31, 2003 4:16 am

I think monmode.txt is just for reference.
This max check exists for sounds.txt awell, even it dosent get compiled into a bin file. I may have made a typo in d2client wile loading my new sounds, but I dont think so.

aka:
Location : C:\Projects\Diablo2\Source\D2Client\Sound\SoundHdr.cpp, line #92
Expression : eSound >= ESOUND_NONE && eSound < NUM_SOUNDS
Last edited by Nefarius on Fri Jan 31, 2003 4:18 am, edited 2 times in total.
''(...) The game can basically be considered unhackable. '' - Blizzard Entertainment (30th May 2000)
Black Omen Productions | MetalStorm: Progress Report | Screenshots

User avatar
om
Junior Member
Champion of the Light
Posts: 464
Joined: Fri Aug 16, 2002 12:48 am
Location: Canada

Re: I DID IT! I added a new token!

Post by om » Fri Jan 31, 2003 4:16 am

yea prety nice thingy u found out, but i find it easyer to just change a few frame counts around, seems faster that way
My new msn: om_silverbolt@hotmail.com
Add me :)

User avatar
Myhrginoc
Retired Admin
Cherub
Posts: 12062
Joined: Sat May 25, 2002 7:28 am
Location: Percussion U

Hand-picked

Re: I DID IT! I added a new token!

Post by Myhrginoc » Fri Jan 31, 2003 7:49 am

Nefarius";p="62607" wrote:I think monmode.txt is just for reference.
This max check exists for sounds.txt awell, even it dosent get compiled into a bin file. I may have made a typo in d2client wile loading my new sounds, but I dont think so.

aka:
Location : C:\Projects\Diablo2\Source\D2Client\Sound\SoundHdr.cpp, line #92
Expression : eSound >= ESOUND_NONE && eSound < NUM_SOUNDS
MonMode.txt does get loaded after MonType, and its tokens appear in the monster token table after the MonType tokens. D2Common.10647 will retrieve a record pointer from either section of the token table, depending on a parameter you select.

10646 (2996)
2 parameters
Arg2 - 0 for CharType, 1 for CharMode
Arg1 - character token table index
returns the record index for the token index table (CharType or CharMode)

10647 (2997)
2 parameters
Arg2 - 0 for MonType, 1 for MonMode
Arg1 - monster token table index
returns the record index for the token index table (MonType or MonMode)

10648 (2998)
2 parameters
Arg2 - 0 for ObjType, 1 for ObjMode
Arg1 - object token table index
returns the record index for the token index table (ObjType or ObjMode)


D2Client.dll has one loading function for Sounds.txt and SoundEnviron.txt. For 1.09b, this is at 6FB527E0. This loader does not call d2common.10578, which is why there are no bin files for these two txt files. The assertion message you quoted is listed twenty times, so the line number will be significant for locating a specific instance. If you expand the table, the upper limit needs to be changed in all twenty comparison locations, and probably elsewhere too.
Do the right thing. It will gratify some people and astonish the rest.
~ Mark Twain
Run Diablo II in any version for mods: tutorial
The Terms of Service!! Know them, abide by them, and enjoy the forums at peace.
The Beginner's Guide v1.4: (MS Word | PDF) || Mod Running Scripts || TFW: Awakening

User avatar
Nefarius
Retired Admin
Cherub
Posts: 11607
Joined: Sat Jun 15, 2002 8:13 pm
Location: Where the blood forever rains
Contact:

Hand-picked

Re: I DID IT! I added a new token!

Post by Nefarius » Fri Jan 31, 2003 3:50 pm

Hmm, There is one additional thing besides the maxID check that would need to get changed. the numComponents_Per_line data, the number of components is hardcoded to the lines in monstats.txt, thats why when you copy a multi-component monster like a skeleton into a single component monster row like the gorgon you will only gte a flying torso. So even if we manage to expand the montype/stats rows we will simply create invisible monsters (the unused Diabolists etc are completly invisible, no matter what you clone into those rows, they have 0 components in the hardcoded data) It may thought be that it wont crash and wont make them invisible, if you estimate that if there is no data for them they will simply get all components but I doubt that one.
''(...) The game can basically be considered unhackable. '' - Blizzard Entertainment (30th May 2000)
Black Omen Productions | MetalStorm: Progress Report | Screenshots

User avatar
rav3n
Junior Member
Paladin
Posts: 116
Joined: Sun Jan 05, 2003 7:50 am
Location: Rio de Janeiro
Contact:

Re: I DID IT! I added a new token!

Post by rav3n » Fri Jan 31, 2003 4:22 pm

nef, so this concludes our PM discussion about quill rats using teeth? :)
i mean if a monster can have all modes now, he can use almost all skills in the game.
--rav3n (?) (@) (#)
Currently working on the Blackned MOD

User avatar
Nefarius
Retired Admin
Cherub
Posts: 11607
Joined: Sat Jun 15, 2002 8:13 pm
Location: Where the blood forever rains
Contact:

Hand-picked

Re: I DID IT! I added a new token!

Post by Nefarius » Fri Jan 31, 2003 4:26 pm

yes as long as you swap the AI correctly.
''(...) The game can basically be considered unhackable. '' - Blizzard Entertainment (30th May 2000)
Black Omen Productions | MetalStorm: Progress Report | Screenshots

Post Reply

Return to “Multimedia”