If it didn't work in Gothic 2, I don't know if I can fix it on my own, I'll try to get hold of Gottfried.
Please give me an example for the animation things.
What? I'll try to fix the gestures bug with the help of Gottfried and I'd like to have a script example for the non-working animations (i.e. a dialog where it should work but doesn't).
That is what everybody should do when submitting bugs, by the way... Post minimal code that should do something (specifiy what), but doesn't do it (specify what happens instead[ and why it shouldn't happen]). This makes it a hell of a lot easier to fix it and I can know for sure whether I fixed the problem completely.
What? I'll try to fix the gestures bug with the help of Gottfried and I'd like to have a script example for the non-working animations (i.e. a dialog where it should work but doesn't).
That is what everybody should do when submitting bugs, by the way... Post minimal code that should do something (specifiy what), but doesn't do it (specify what happens instead[ and why it shouldn't happen]). This makes it a hell of a lot easier to fix it and I can know for sure whether I fixed the problem completely.
I meant this:
Please give me an example for the animation things.
That's sample tria:
Code:
var c_npc Diego; Diego = Hlp_GetNpc(PC_Thief);
var c_npc Test; Test = Hlp_GetNpc(TEST_999_Trialoge);
var c_npc Test2; Test2 = Hlp_GetNpc(TEST_998_Trialoge);
TRIA_Invite(Test);
TRIA_Invite(Test2);
TRIA_Start();
TRIA_Next(Diego);
DIAG_Reset();
AI_Output (self, other, "TRIA_TEST_00"); // bla bla
TRIA_Next(Test);
AI_Output (other, self, "TRIA_TEST_01"); // bla bla
AI_GotoNpc(self, other);
AI_TurnToNpc(other, self);
AI_Output (self, other, "TRIA_TEST_02"); // bla bla
DIAG("Nervous", 1, 2);
AI_Output (other, self, "TRIA_TEST_03"); // bla bla
DIAG_Reset();
TRIA_Cam("CAMERASTART");
TRIA_Next(Test2);
AI_TurnToNpc(other, self);
DIAG("No", 0, 1);
AI_Output (self, other, "TRIA_TEST_04"); // bla bla
TRIA_Next(Diego);
DIAG("NotSure", 0, 1);
AI_Output (other, self, "TRIA_TEST_05"); // bla bla
AI_TurnToNpc(other, self);
TRIA_Cam("");
DIAG("Angry", 0, 4);
AI_Output (self, other, "TRIA_TEST_06"); // bla bla
DIAG_Reset();
AI_Output (other, self, "TRIA_TEST_07"); // bla bla.
TRIA_Finish();
You didn't tell me whats supposed to happen and what happens instead (e.g. what is missing), but I presume you're talking about the dialog gestures? I thought you reported another bug in Post #59.
You didn't tell me whats supposed to happen and what happens instead (e.g. what is missing), but I presume you're talking about the dialog gestures? I thought you reported another bug in Post #59.
Yes, dialog gestures. Fack my hard thinking dumb brain
I should mention about that immadietly, sorry for wasted time
I just found (and fixed) a bug that has always been a mysterium for me.
(Somewhat technical explanation follows)
Spoiler:(zum lesen bitte Text markieren)
Whenever LeGo tried to save its data (i.e. PermMem objects), the last two didn't seem to land in the savegame. I had tinkered enough with PermMem to hate it at that point and decided to not hunt down the bug but simply allocate two empty objects right before saving. It's a dirty, dirty workaround, but it worked for me, so I let it slide.
What I didn't know was that this "off-by-two" error wasn't an "off-by-two" error. In fact, it was an "off-by-however-many-objects-you-deleted" error It never occurred to me since it seemed static to me - apparently LeGo deletes exactly two objects during initialisation via LeGo_Init(LeGo_All);.
This occured because I indirectly assumed the number of existing handles to be the key of the highest/newest handle (so when you deleted 2 old objects the number of handles is e.g. 7 while the "latest" handle has the number 9).
This is the same bug I observed with the LoA scripts (but couldn't find at that time).
Edit: This version contains a new bug that may cause problems with bars (they appear empty), FrameFunctions (they don't seem to work after loading) and potetially other scripts - if you encounter any of these, waiting for a fix might be preferable. I identified the problem and should be able to fix it within this weekend.
Zitat von hatrez123
Yes, dialog gestures. Fack my hard thinking dumb brain
I should mention about that immadietly, sorry for wasted time
I don't know if it was meant, but it seems that in the last package you uploaded there aren't the latest versions of every files. I made a check and view.d is still to the previous version (no viewptr_settexture for example), list isn't updated yet, and last change date of userconst and engineadr in the svn is more recent than in that package. Just saying :P I checked because I had used some function from the latest view that wasn't there.
Almost everything works now, no crash, correct TAL_GetValue. Apart that on the first loading stamina seems to not work. To make it work I just have to pause and unpause the game (ESC) and it works again. On second loading seems to work great. (and that annoying thing that I have to trigger FF on every loading but that is perfectly passable)
I don't know if it was meant, but it seems that in the last package you uploaded there aren't the latest versions of every files. I made a check and view.d is still to the previous version (no viewptr_settexture for example), list isn't updated yet, and last change date of userconst and engineadr in the svn is more recent than in that package. Just saying :P I checked because I had used some function from the latest view that wasn't there.
Almost everything works now, no crash, correct TAL_GetValue. Apart that on the first loading stamina seems to not work. To make it work I just have to pause and unpause the game (ESC) and it works again. On second loading seems to work great. (and that annoying thing that I have to trigger FF on every loading but that is perfectly passable)
I have literally no idea how that would've happened, but I updated the files, so it should be correct now.
//========================================// Animation direkt setzen
//========================================
func void _DIAG_SetAni(var string AniName) {
_DIAG_Patch();
const int T_DIALOGGESTURE_ = 9148264; // 0x8B9768
MemoryProtectionOverride(T_DIALOGGESTURE_, 16);
AniName = STR_Upper(AniName);
var zString ani; ani = MEM_PtrToInst(STR_GetAddress(AniName));
if(ani.len < 1 || ani.len > 15) {
MEM_Error("DIAG_SetAni: Length of AniName has to be between 0 and 16");
};
MEM_CopyBytes(ani.ptr, T_DIALOGGESTURE_, ani.len+1); // +1 für \0
};
Ich habe soweit ich weiß nix an den Anis verändert. Absturz ist reproduzierbar und tritt auf, wenn ich den Npc zum ersten Mal anspreche. Also erster Dialog ist ein Trialog mit 4 Gesprächspartnern.
Hier ein Ausschnitt...
var c_npc TRIA_Adrion; TRIA_Adrion = Hlp_GetNpc(loa_kdf_6194_AdrionST);
var c_npc TRIA_Cortez; TRIA_Cortez = Hlp_GetNpc(LOA_MIL_6192_CortezST);
var c_npc TRIA_Magus; TRIA_Magus = Hlp_GetNpc(LOA_KDF_6193_MagusST);
var c_npc TRIA_Flint; TRIA_Flint = Hlp_GetNpc(loa_kmp_6191_FlintST);
TRIA_Next(TRIA_Flint);
>>Ah, na hallo. Wiedersehen macht Freude, was?
>>Ich hatte schon befürchtet, dass ihr mir noch alle aufs Dach steigt.
<<Oh Mann. Ich dachte zwischendurch noch, ich würde ersticken. Wie könnt ihr das mit dem Teleportieren überhaupt aushalten? Da dreht sich einem auf die Dauer doch der Magen um.
TRIA_Next(TRIA_Adrion);
...
Gottfried hat da irgendwie Code geschrieben, der standardmäßig eine Ausnahme hervorruft. Seine vorgeschlagene Änderung ist einfach in der Dialoggestures.d in Zeile 64 die 15 zu einer 19 (glaube ich) zu ändern. Werde mir das in nächster Zeit mal ein wenig tiefergehend anschauen, hatte das sowieso vor.
//========================================// Animation direkt setzen
//========================================
func void _DIAG_SetAni(var string AniName) {
_DIAG_Patch();
const int T_DIALOGGESTURE_ = 9148264; // 0x8B9768
MemoryProtectionOverride(T_DIALOGGESTURE_, 16);
AniName = STR_Upper(AniName);
var zString ani; ani = MEM_PtrToInst(STR_GetAddress(AniName));
if(ani.len < 1 || ani.len > 15) {
MEM_Error("DIAG_SetAni: Length of AniName has to be between 0 and 16");
};
MEM_CopyBytes(ani.ptr, T_DIALOGGESTURE_, ani.len+1); // +1 für \0
};
ich habe mir mit ner Infobox die ani.len ausgeben lassen. Es sagt 17.
Aber wieso muss die Anilänge kleiner 16 sein? Es werden doch 16 freigegeben und auch bei grün maximal 16 kopiert .
Ich habe übrigens keine neuen Dialoggestures hinzugefügt.
kann man nicht einfach T_DIALOGGESTURE_ größer machen?
EDIT: Die Lösung mit der 19 klappt zumindest vorerst. Ich behalte das im Auge.
Hallo,
ich würde gerne in der B_GiveDeathInv(var C_Npc slf) eine aivar des sterbenden Npcs verändern wollen.
Also in dem Fall. AIV_DEAD.
Bei mir geben die Testprints aber immer null aus.
Ich denke, es liegt an der Übergabeweise von Gothic der Parameter für die Funktion B_GiveDeathInv
Kann mir da jemand weiterhelfen, wie ich an die originale Instanz von slf komme, damit ich die manipulieren kann?
Dann sind vermutlich deine Tests falsch, eigentlich sollte das ganz normal funktionieren. Die B_GiveDeathInv() wird von den originalen Scripten aufgerufen, oder?
ja wird von der zs_dead aufgerufen, aber wenn ich da die aivar setze, dann verändert sich der Wert nicht. Oder es wird wohl bei einem anderen Npc gesetzt.
Hmm...
Edit: Wurde gelöst. Seltsamerweise kann man mit slf.aivar[] nix beim angesprochenen Npc setzen. Liegt wohl daran, dass der Npc self als Kopie in slf übergeben wird.
Ich habe dann das Setzen mit self.aivar gemacht und dann ging es auf einmal. Mit dem parameter slf. kann man aber weiterhin die Variablen abfragen, da ja slf eine kopie von self ist.
I'm trying to call a function by hooking hero melee weapon attacks, but my problem is that the function is calling several times during one a single attack.