Do you mind to publish the source code for the displayed keystrokes? I would love to create a Patch out of it for players so they can display it
I don't mind at all - especially with fellow Bleach fan
Global variables:
Code:
var int pickLockString_Mob; //Mob identification
var string pickLockString_Last; //Last successfully tested picklock string
var string pickLockString_Current; //Current picklock string
Hooked functions:
Code:
//00682990 .text Debug data ?PickLock@oCMobLockable@@MAEHPAVoCNpc@@D@Z
const int oCMobLockable__PickLock_G1 = 6826384;
//0x00724800 protected: virtual int __thiscall oCMobLockable::PickLock(class oCNpc *,char)
const int oCMobLockable__PickLock_G2 = 7489536;
FUNC VOID _HOOK_MOBCONTAINER_PICKLOCK ()
{
var oCNPC slf;
slf = _^ (MEM_ReadInt (ESP + 4));
if (NPC_IsPlayer (slf))
{
var oCMobLockable mob;
mob = _^ (ECX);
var int c;
c = MEM_ReadInt (ESP + 8);
var string pickLockString;
var int currCharCount;
currCharCount = (mob.bitfield & oCMobLockable_bitfield_pickLockNr) >> 2;
//Get current picklock string + 1
currCharCount += 1;
if (currCharCount > 0)
{
pickLockString = STR_Prefix (mob.pickLockStr, currCharCount);
};
//Compare players attempt with current picklock string + 1
if (c == 76) {
if (Hlp_StrCmp(ConcatStrings (pickLockString_Current, "L"), pickLockString))
{
pickLockString_Current = pickLockString;
};
} else
if (c == 82) {
if (Hlp_StrCmp(ConcatStrings (pickLockString_Current, "R"), pickLockString))
{
pickLockString_Current = pickLockString;
};
};
//If successfull then remember it :)
if (STR_Len (pickLockString_Current) > STR_Len (pickLockString_Last))
{
pickLockString_Last = pickLockString_Current;
};
};
};
//0067FCA0 .text Debug data ?StartInteraction@oCMobInter@@MAEXPAVoCNPC@@@Z
const int oCMobInter__StartInteraction_G1 = 6814880;
//0x00721580 protected: virtual void __thiscall oCMobInter::StartInteraction(class oCNpc *)
const int oCMobInter__StartInteraction_G2 = 7476608;
FUNC VOID _HOOK_MOBINTER_STARTINTERACTION ()
{
var oCNPC slf;
slf = _^ (MEM_ReadInt (ESP + 4));
if (NPC_IsPlayer (slf))
{
if (Hlp_Is_oCMobLockable (ECX))
{
var oCMobLockable mob;
mob = _^ (ECX);
//Reset for new mob
if (STR_Len (pickLockString_Last) > 0)
{
if (pickLockString_Mob != ECX)
{
pickLockString_Current = "";
pickLockString_Last = "";
};
};
pickLockString_Mob = ECX;
//Update for lock which was already partially picklocked
var int currCharCount;
currCharCount = (mob.bitfield & oCMobLockable_bitfield_pickLockNr) >> 2;
if (currCharCount > 0)
{
pickLockString_Current = STR_Prefix (mob.pickLockStr, currCharCount);
} else {
pickLockString_Current = "";
};
//Open view
...
};
};
};
//0067FFD0 .text Debug data ?EndInteraction@oCMobInter@@UAEXPAVoCNPC@@H@Z
const int oCMobInter__EndInteraction_G1 = 6815696;
//0x00721950 public: virtual void __thiscall oCMobInter::EndInteraction(class oCNpc *,int)
const int oCMobInter__EndInteraction_G2 = 7477584;
FUNC VOID _HOOK_MOBINTER_ENDINTERACTION ()
{
var oCNPC slf;
slf = _^ (MEM_ReadInt (ESP + 4));
if (NPC_IsPlayer (slf))
{
if (Hlp_Is_oCMobLockable (ECX))
{
//Close view
...
};
};
};
//00680250 .text Debug data ?StopInteraction@oCMobInter@@UAEXPAVoCNPC@@@Z
const int oCMobInter__StopInteraction_G1 = 6816336;
//0x00721C20 public: virtual void __thiscall oCMobInter::StopInteraction(class oCNpc *)
const int oCMobInter__StopInteraction_G2 = 7478304;
FUNC VOID _HOOK_MOBINTER_STOPINTERACTION ()
{
var oCNPC slf;
slf = _^ (MEM_ReadInt (ESP + 4));
if (NPC_IsPlayer (slf))
{
if (Hlp_Is_oCMobLockable (ECX))
{
//Reset
pickLockString_Current = "";
//Close view
...
};
};
};
'Standard' Gothic function G_PickLock should be updated also:
Code:
func void G_PickLock (var int bSuccess, var int bBrokenOpen)
{
if (bSuccess)
{
if (bBrokenOpen)
{
Snd_Play3D (hero, "PICKLOCK_UNLOCK");
Print (PRINT_PICKLOCK_UNLOCK);
//Reset
pickLockString_Current = "";
}
else
{
Snd_Play3D (hero, "PICKLOCK_SUCCESS");
Print (PRINT_PICKLOCK_SUCCESS);
};
}
else
{
if (bBrokenOpen)
{
Snd_Play3D (hero, "PICKLOCK_BROKEN");
Print (PRINT_PICKLOCK_BROKEN);
var int rnd; rnd = Hlp_Random(100);
if (rnd <= 25)
{
Npc_SendPassivePerc (hero, PERC_ASSESSQUIETSOUND, hero, hero);
};
}
else
{
Snd_Play3D (hero, "PICKLOCK_FAILURE");
Print (PRINT_PICKLOCK_FAILURE);
};
//Reset
pickLockString_Current = "";
};
};
As for View piece (where text is displayed on screen) of code - I wont put it here - as it's messy. I don't know how to work properly with LeGo Views yet - will have to spend some time in future with it ...
Basically you just have to display both strings pickLockString_Last (RGBA (255, 255, 255, 64)) overlayed with pickLockString_Current RGBA (096, 255, 096, 255) in same position on screen.
Hat jemand noch zufällig die alte Ikarus Version 1.1.4? Die bräuchte ich mal um etwas abzugleichen. Der Download im Einleitungspost ist aber mittlerweile nicht mehr erreichbar.
Hat jemand noch zufällig die alte Ikarus Version 1.1.4? Die bräuchte ich mal um etwas abzugleichen. Der Download im Einleitungspost ist aber mittlerweile nicht mehr erreichbar.
(Fawkes, your upload was actually 1.2.1 - I guess the documentation needs to be updated. EDIT: I guess not. I think it's the version corresponding to the documentation, so it seems fine.)
Mittlerweile haben sich einige Ausbesserungen an Ikarus angesammelt und wir möchten Version 1.2.2 vorstellen. Größtenteils handelt es sich um interne Verbesserungen um seltenen Abstürzen entgegen zu wirken oder kleine Fehler auszumerzen. Für den Normalgebrauch ist ansonsten vor allem die Vervollständigung der Engineklassen unter Gothic 1 interessant. So sind Gothic 1 und Gothic 2 nun endlich gleich auf.
Folgende Verbesserungen wurden eingebaut (click here for English):
Sicherere Implementierungen von MEM_ReadByte und MEM_WriteByte: Behebt seltene Abstürze und macht es etwas schneller
Fehlende Gothic 1 Klassen hinzugefügt (für eine vollständige Liste siehe hier)
Weitere Hlp_Is-Funktionen für Mobs hinzugefügt (für eine vollständige Liste siehe hier)
STR_Lower Funktion hinzugefügt (analog zu STR_Upper)
Hexadezimal-Umrechnungen korrigiert: Großbuchstaben A bis F in MEMINT_HexCharToInt und MEMINT_ByteToKeyHex hinzugefügt
Warnungen verborgen, wenn bei Initialisierung keine Kamera, Infomanager oder Spawnmanager existieren, z.B. wenn aus Init_Perceptions initialisiert wird
MEM_GetFuncIDByOffset für mit MEM_ReplaceFunc überschriebene Funktionen korrigiert, z.B. MEM_ReadInt: While-Schleifen laufen nun stabiler
Erkennung des Codestack-Endes bei Sprüngen (Tokenizing) eingebaut: Endlosschleifen werden nun vermieden
MEMINT_SwitchG1G2 ausgebessert
Potentielle Absturzquelle beim Cachen von Funktionen in MEM_CallByString behoben
Fürs Arbeiten mit Ikarus ändert sich dadurch nichts. Aufgrund der vielen Fixes ist dies Aktualisierung sehr zu empfehlen.
Ich würde an dieser Stelle einen Moderatoren bitten, den Einleitungspost vom Ikarus-Thread mit dem Download-Link zur Version 1.2.2 zu ergänzen. Vielen Dank!
I have updated in the mod to check so far everything is fine. Update the version in Ninja, there is a crash due to different versions of ikarus, so I temporarily turned it off.
I have updated in the mod to check so far everything is fine. Update the version in Ninja, there is a crash due to different versions of ikarus, so I temporarily turned it off.
That is correct. A update for Ninja is scheduled for today. Since it's highly unlikely that a mod would release between last night and tonight, this should not be an issue.
PS: I wouldn't exactly call that a crash by the way. It's an error message and proper termination, well intended.
Hello. In one Polish mod, the old version of ikarus is very different from the base version 1.2.0. Compared with the actual, there are differences that seem reasonable. Should I upgrade to current?
Aufgerufen aus einer Triggerschleife, das war noch vor FrameFunctions. Weiß nicht, ob das evtl. einen Unterschied macht. Ansonsten speicher ich das halt in den Quicksave-Slot, nicht in Slot 5. Also die zwei Dinge könntest du mal testen.
Aufgerufen aus einer Triggerschleife, das war noch vor FrameFunctions. Weiß nicht, ob das evtl. einen Unterschied macht. Ansonsten speicher ich das halt in den Quicksave-Slot, nicht in Slot 5. Also die zwei Dinge könntest du mal testen.