Thread: Cadaver remake
View Single Post
Old 28 July 2010, 16:20   #79
Kroah
Registered User

Kroah's Avatar
 
Join Date: Apr 2009
Location: France
Age: 40
Posts: 112
Here's the header of the TAD files:

Code:
struct TAD_Header { // size: 0x50
  word offsetToFunction_LevelInit;     // +00
  word offsetToVectors_Drink;          // +02 used in IconAction_Drink
  word offsetToVectors_Spell;          // +04 used in CastSpell & ObjectsHeartbeat
  word offsetToVectors_EffectEnd;      // +06 used in HandleTimerAndSpecialZones
  word offsetToUnksWord_LevelEnd;      // +08 used in LevelEnd (items to keep at the end of level)
  word nbRoomsDevelopper;              // +0A nb rooms not counted in complete %
  word floorGfxIndexForDoorOnFloor;    // +0C
  word floorGfxIndexForDoorOnHeight;   // +0E
  word fieldsUnk [12];                 // +10
  word vectors_CreatureThink [10] [2]; // +28 [4][]=WaterDragon, [5][] Worm, [6][] StarTentacle
}
Remarks:
- If the TAD file starts with a LONG containing the file length, remove it (ST/Amiga files).

- All offsets in the header are from the start of the TAD file.

- offsetToFunction_LevelInit:
It points to 2 bytes, then the function.

- offsetToVectors_Drink:
Used when the hero drinks something.
It points to an array of function offsets.
The offset base is offsetToVectors_Drink.
The item has a index for this array.

- offsetToVectors_Spell:
Used when the hero or a creature casts a spell.
It points to an array of function offsets.
The offset base is offsetToVectors_Spell.
The item has a index for this array.

- offsetToVectors_EffectEnd:
Used when an effect ends (an effect has a duration like alcohol, poison).
It points to an array of function offsets.
The offset base is offsetToVectors_EffectEnd.
The item has a index for this array.

There are 52 effects in the game. For example, #32 is Alcohol effect, #39 is invulnerability.
I think that if a level uses an effect, it's included in its TAD file.
We may create a full version of the TAD file containing all effects in the offsetToVectors_EffectEnd by using multiple levels.

- vectors_CreatureThink:
This is an array of function offsets.
The offset base is vectors_CreatureThink.
Each function offset points to 2 bytes, then the function.
The creature has an index for this array.

After fixing some bugs, I'll release the viewer. I won't have time to look deeper to port the TAD files across system and it's not on my priority list (I'm not a fan of the PC version of Cadaver).

Hope it helps,
Kroah is offline  
 
Page generated in 0.08620 seconds with 9 queries