11-07-18, 19:00 | #451 |
Member
Joined: Dec 2009
Posts: 1,428
|
|
13-07-18, 18:22 | #452 |
Moderator
Joined: Jul 2003
Posts: 33,359
|
I used Leikkuri with Mists of Avalon - part 1.
So it works fine with that version of TRNG. I am not using it anymore, so I do not know if it still works. If it works, it might only work with the tomb4.exe with the red icon. Just like with FLEP. |
03-10-18, 16:37 | #453 |
Moderator
Joined: Dec 2011
Posts: 4,881
|
How can I identify a route for a variable in the code, if I cannot find the "links"?
Just a random example, in the case of pDashBarValue: Code:
typedef struct StrGlobAddress { StrItemTr4 *pLara; StrRoomTr4 *pVetRooms; StrItemTr4 *pVetItems; int *pTotItemsAtBegin; int *pTotItems; // era "AncoraTotItems" StrInventoryItems *pInventory; ... short *pDashBarValue; BYTE *pVetDrip; WORD *pPoison1; ... }GlobAddress; Code:
typedef struct StrGlobaliTomb4 { StrBaseRemapMemory BaseRemap; // remapped memory zones in tomb4 DWORD FlagsLevel; // valore FL_... StrPrefTomb MyPrefTomb; StrBaseFog BaseFog; ... StrGlobAddress *pAdr; WORD ClimbFlags; StrEnvPosition EnvPosition; ... Searching more in the way like this, the final route will be *Trng.pGlobTomb4->pAdr-> pDashBarValue. But, for example I have this: Code:
typedef struct StrSoundInfos { short Indice; BYTE Volume; BYTE RAD; // valore originale BYTE CH; // totale con 100 = 255 char PIT; // valori positivi o negativi con massimi (+/) 128 WORD Flags; // FSI_ }SoundInfosFields; (StrZonaSound *pVetSfxSoundInfos is for another structure, as you can see.) |
03-10-18, 18:35 | #454 |
Member
Joined: Sep 2006
Posts: 674
|
In such cases I think you'll need to "link" it yourself.
Each of those *variables are pointers to memory offsets where the actual data is stored. Paolone probably didn't think it was worth adding a pointer to that data or perhaps just missed it. This will take a bit of digging through the assembly sources, but once you get comfortable with that it might open many more options for you. Take a look at Tomb4Data.txt in the Tomb4Sources folder of the plugin sdk. At offset 7F7584 is the start of Ptr_VetSoundInfos which seems to be a pointer to a vector of structs: Code:
7F7584: Ptr_VetSoundInfos: Code:
int *Ptr_VetSoundInfos = (int*)0x7F7584; StrSoundInfos *pVetSoundInfos = (StrSoundInfos*)*Ptr_VetSoundInfos; Code:
7F70F0: TotSoundInfos: Code:
int TotSoundInfos = *(int*)0x7F70F0; Code:
int *Ptr_VetSoundInfos = (int*)0x7F7584; StrSoundInfos *pVetSoundInfos = (StrSoundInfos*)*Ptr_VetSoundInfos; int TotSoundInfos = *(int*)0x7F70F0; for (int i = 0; i < TotSoundInfos; ++i) { StrSoundInfos &SoundInfo = pVetSoundInfos[i]; // turn up the volume! SoundInfo.Volume = 255; // and play every time SoundInfo.CH = 255; } |
03-10-18, 21:30 | #455 | |||
Moderator
Joined: Dec 2011
Posts: 4,881
|
Quote:
Quote:
Quote:
Plus, this method is something really important I learned today. |
|||
11-10-18, 14:09 | #456 |
Member
Joined: Nov 2007
Posts: 7,582
|
sorry guys, wrong thread NVM
Last edited by dcw123; 11-10-18 at 14:30. |
11-10-18, 21:43 | #457 | |
Moderator
Joined: Dec 2011
Posts: 4,881
|
Quote:
For example, if you have this order of rooms in the editor: Room0 Room7 Room12 then in the game the empty slots will be ignored, so, the room list, in the same order, will be calculated with other indices in the game: Room0 Room1 Room2 But I talk about sounds now. TotSoundInfos refer to the "tomb4 indices" of sound groups (not sound samples!). (IndiceRel in StrZonaSound can do something similar, but that notices a sound group only if one of the samples of the group is just playing and being heard.) My problem is I'd like to know which is the NGLE ID of a required tomb4 sound group index. I mean, builder cannot know the tomb4 sound indices, so I need to ask them to choose an NGLE sound index if they want to change eg. the volume of its sample(s) during the game. But sound properties seem to be defined only for tomb4 indices, not for NGLE indices. So eg. this is what I need: 1. Builder chooses an NGLE sound group index. (It can be easily identified if they open the sound table from the drop down menu of NGLE.) 2. Engine converts it into tomb4 sound group index. 3. Engine changes the volume. The problem is there is no converter like that. Convert function of Paolone is for Moveables, rooms, animations, frames etc., but not for sounds. So the question is how can I identify in the code which NGLE sound group index refers to which tomb4 sound group index, and vice verse? |
|
12-10-18, 09:32 | #458 |
Member
Joined: Sep 2006
Posts: 674
|
NGLE and tomb4 both use the same ID to refer to a given "sound group", e.g. 2 = LARA_NO. These IDs will stay the same for each level, i.e. 0-369.
What tomb4 does internally though is to keep an array containing only the infos for the sound groups present in the level, so a given ID won't match its index in the array except if all sounds are present. TotSoundInfos is just the size of this array. This means to get the info for a given sound group, we have to map its ID to its index in the array. This is where the missing piece of the puzzle comes in, Ptr_VetSoundIndices. The size of pVetSoundIndices is 370, so each entry corresponds to a sound group. Each value in the array contains the mapped index into the array of sound infos, i.e. pVetSoundInfos. Using this mapped index we can then get the StrSoundInfos. If the index is less than 0 it means the sound is not present. Sample code below: Code:
int *Ptr_VetSoundIndices = (int*)0x7F7580; short *pVetSoundIndices = (short*)*Ptr_VetSoundIndices; int *Ptr_VetSoundInfos = (int*)0x7F7584; StrSoundInfos *pVetSoundInfos = (StrSoundInfos*)*Ptr_VetSoundInfos; // fixed sound ID for whole game in range 0-369, e.g. 2 = LARA_NO int SoundID = 29; // LARA_JUMP // map fixed sound ID to level sound index short SoundIndex = pVetSoundIndices[SoundID]; if (SoundIndex >= 0) { // -1 means not present, can also be -2 StrSoundInfos &SoundInfo = pVetSoundInfos[SoundIndex]; // turn up the volume! SoundInfo.Volume = 255; // and play every time SoundInfo.CH = 255; } https://trwiki.earvillage.net/doku.p...s:sound#sounds Here SoundMap refers to pVetSoundIndices and SoundDetails to pVetSoundInfos Last edited by JMN; 12-10-18 at 09:40. |
12-10-18, 16:55 | #459 |
Moderator
Joined: Dec 2011
Posts: 4,881
|
So the key is Ptr_VetSoundIndices this time.
Thank you. I'll try it soon. |
23-10-18, 15:54 | #460 |
Member
Joined: Feb 2018
Posts: 151
|
Hello I have a question, LoreRaider has already given me some advice, but unfortunately I've already tried this. (With the Mapconverter2) I have a waterfall texture in 128x128 in my tga, I would like to animate it with the Animating range. (Did it like in the tutorial of Titka.) The problem is that it does not flow, it already has a flip effect tried, unfortunately, this doesn´t work. Unfortunately, I do not know any other advice. Can somebody help me with it? Thank you
|
Thread Tools | |
|
|