|
-
PC_Hero Untertitel sowie bei NPCs
Ist es möglich, dass die Untertitel vom PC_Hero, wie bei den Gesprächspartner NPCs, mit gelben Text und Namen angezeigt werden?
Ich möchte ermöglichen, dass man dem Helden einen Namen geben kann, das wird in diesem Thread erläutert: https://forum.worldofplayers.de/foru...harakter-wahl?
Cool wäre es dann halt noch, wenn man den Namen auch in den Dialogen sieht und nicht nur zB im Charaktermenü.
-
Ich hätte eine ähnliche Frage: Ich würde gern den gelben Farbton bei den NPC-Dialogen abschalten.
-
Gelben Farbton abschalten kann ich dir sagen :D Das andere geht auch.
In oCNpc::EV_PlaySound (0x007584F0), wird bei 0x007650CB + 1 der offset für NPC_COLOR_TALK_PC (was ne zCOLOR 0xFFFFFFFF ARGB ist) gepushed. Der offset ist 0x00AB1FDC. Das ist für Dialoge vom Helden. Der call von zCView::DialogMessageCXY() ist hier bei 0x00758ABD
Bei 0x00758B1D + 1 wird der offset für NPC_COLOR_TALK_NPC (was ne zCOLOR 0xFFFFFF00 ARGB ist) *gepushed. Der offset ist 0x00AB1E90. Das ist für Dialoge von NPcs. Der call von gleicher Funktion ist hier bei 0x00758B2F.
Bei Dialogen für den Helden wird als erstes Argument (also das direkt nach dem this pointer für den thiscall) ein leerer zSTRING übergeben. Bei Dialogen für NPCs wird von "this" über GetName() der Name geholt und übergeben.
Ich kenne mich mit Ikarus/Lego quasi gar nicht aus, aber in C++ würde ich das so anstellen dass ich DialogMessageCXY() bei z.B. für den Helden hooke mit einer eigenen Funktion mit gleichem prototypen, in der die originale Funktion aufrufe, und mir davor den Namen von oCNpc::player hole und dann den und die Farbe die ich will übergebe statt den originalen Daten.
Der Prototyp der Funktion ist:
void __thiscall zCView::DialogMessageCXY(zCView *this, const zSTRING *strNPC, const zSTRING *strMessage, float fTime, struct zCOLOR *col)
bzw.
void __thiscall zCView::DialogMessageCXY(class zSTRING const &, class zSTRING const &, float, struct zCOLOR &)
Hoffe das hilft weiter.
Farbe austauschen sollte natürlich simpler sein. Da tauscht man einfach den offset aus der gepushed wird. Falls hier irgendwas grob falsch ist, bitte schnell bescheid sagen :D
Geändert von withmorten (01.04.2019 um 05:14 Uhr)
-
Ich möchte das Thema nochmal hervorholen.
Danke erstmal an withmorten! Leider kann ich noch nichts mit der vorgeschlagen Lösung anfangen.
Könnte mir bitte jemand das nochmal laienhafter gestalten.
-
Ist vielleicht nicht deine favorisierte Lösung, aber im SystemPack kannst du in der .ini diese ganzen Farben einfach einstellen. Farbtonbeispiele sind im russischen SystemPack Thread auf wog.ru. Aber wenn einfach die Spielerdialoge gelb sein sollen wie bei den NPCs, kannst du ja einfach den schon gegebenen Farbcode in der .ini auch an der anderen Stelle eintragen.
-
G1 Colorful conversations
Hi Moe,
After several trial-errors with function which Withmorten suggested - hook below is able to change color of both 'noise' + 'standard' dialogs and gives you possibility to add Hero's name into conversation. In code below just for demonstration purposes I used green color for noise dialogs, red color for player dialog and blue for npc dialog.
Also added small feature if you put h@ and color in hex code at the beginning of your dialog, you can change color dynamically with dialogs.
Code:
const int zCView__DialogMessageCXY_G1 = 7337648;
//006FF6B0 .text Debug data ?DialogMessageCXY@zCView@@QAEXABVzSTRING@@0MAAUzCOLOR@@@Z
const int zCView__DialogMessageCXY_G2 = 8032832;
//0x007A9240 public: void __thiscall zCView::DialogMessageCXY(class zSTRING const &,class zSTRING const &,float,struct zCOLOR &)
FUNC VOID _HOOK_DIALOGMESSAGECXY ()
{
/*
enum oTGameDialogView
{
GAME_VIEW_SCREEN ,
GAME_VIEW_CONVERSATION ,
GAME_VIEW_AMBIENT ,
GAME_VIEW_CINEMA ,
GAME_VIEW_CHOICE ,
GAME_VIEW_NOISE ,
GAME_VIEW_MAX
}*/
const int cGAME_VIEW_CONVERSATION = 1;
const int cGAME_VIEW_NOISE = 5;
var int color;
var string npcName;
npcName = MEM_ReadString (MEM_ReadInt (ESP + 4));
var string dlgText;
dlgText = MEM_ReadString (MEM_ReadInt (ESP + 8));
//Dialog conversation
if (ECX == MEM_Game.array_view [cGAME_VIEW_CONVERSATION])
{
//Change color - different for hero, different for NPC
if (STR_Len (npcName) == 0) //hero's name is empty string
{
//hero
color = RGBA (255, 0, 0, 255); //RED
//Update hero's name
MEM_WriteString (MEM_ReadInt (ESP + 4), "Hero");
} else
{
//NPC
color = RGBA (0, 0, 255, 255); //BLUE
};
} else
//Noise conversation
if (ECX == MEM_Game.array_view [cGAME_VIEW_NOISE])
{
//Change color to green
color = RGBA (0, 255, 0, 255); //GREEN
};
//Change color - extract color from dialog
//h@FF8000 Orange text
if (STR_StartsWith (dlgText, "h@"))
{
var int len;
var int index;
var string newColor;
len = STR_Len (dlgText);
len -= 2;
dlgText = STR_SubStr (dlgText, 2, len);
index = STR_IndexOf (dlgText, " ");
if (index > 0)
{
len = STR_Len (dlgText) - 1;
newColor = STR_Prefix (dlgText, index);
dlgText = STR_SubStr (dlgText, index + 1, len);
color = HEX2RGBA (newColor);
//Update dialog
MEM_WriteString (MEM_ReadInt (ESP + 8), dlgText);
};
};
MEM_WriteInt (MEM_ReadInt (ESP + 16), color);
};
//Not sure if this works with G2A - tested with G1 only
HookEngine (MEMINT_SwitchG1G2 (zCView__DialogMessageCXY_G1, zCView__DialogMessageCXY_G2), 6, "_HOOK_DIALOGMESSAGECXY");
In video I didn't update hero's name - but it was working when I tested it after recording
[Video]
Orange dialog with Diego:
Code:
INSTANCE DIA_Diego_Colored_Dialog (C_Info)
{
npc = PC_Thief;
nr = 1;
condition = DIA_Diego_Colored_Dialog_Condition;
information = DIA_Diego_Colored_Dialog_Info;
permanent = TRUE;
description = "Orange dialog text";
};
FUNC INT DIA_Diego_Colored_Dialog_Condition ()
{
return TRUE;
};
FUNC VOID DIA_Diego_Colored_Dialog_Info ()
{
AI_Output (self, other, "DIA_Diego_Colored_Dialog_Info_15_00"); //h@FF8000 Orange text
};
HEX2RGBA function can be found here:
https://forum.worldofplayers.de/foru...light=HEX2RGBA
edit: obviously - both LeGo and Ikarus packages are required.
-
Thanks F a w k e s!
I get Syntax Error at line hookengine….
-
Zitat von Moe
Thanks F a w k e s!
I get Syntax Error at line hookengine….
Ah, put that line into your Init_Global function it should look somehow like this:
Code:
func void Init_Global ()
{
...
LeGo_Init ...
...
const int once = 0;
if (!once) {
HookEngine (MEMINT_SwitchG1G2 (zCView__DialogMessageCXY_G1, zCView__DialogMessageCXY_G2), 6, "_HOOK_DIALOGMESSAGECXY");
once = 1;
};
};
-
Super works like a charm.
-
How is it possible to change the font color of dialoge choices to yellow for example?
-
-
Zitat von F a w k e s
Be careful - this can't be used with dialog choices (Info_AddChoice...)
So it's not possible to simply change the font color of every dialog choice including addchoices to yellow?
-
Whole solution is able to work with dialog choices - you can use it to change dialog choices
Sorry for confusion - when I mentioned in the code that you can't use it to get dialog choices I was referring to these 2 functions only --> oCInfoManager_GetInfo, oCInfoManager_GetInfoUnimportant - these will not return dialog choice ptr.
If you read further down in the code, there is a bit in the middle where script recognizes dialog mode and figures out whether it needs to work with dialog instance, or dialog choice:
Code:
...
//'Standard' dialog options
if (MEM_InformationMan.Mode == cINFO_MGR_MODE_INFO)
{
infoPtr = oCInfoManager_GetInfoUnimportant (slf, her, i);
} else
//Choices - have to be extracted from oCInfo.listChoices_next
//MEM_InformationMan.Info is a pointer to oCInfo
if (MEM_InformationMan.Mode == cINFO_MGR_MODE_CHOICE)
{
infoPtr = MEM_InformationMan.Info;
};
...
This solution allows you to change both color & font dynamically for every single dialog/dialog choice separately.
What are you trying to achieve - do you want to change dialog color of all dialogs just to yellow color?
Geändert von F a w k e s (27.08.2020 um 10:25 Uhr)
-
Zitat von F a w k e s
What are you trying to achieve - do you want to change dialog color of all dialogs just to yellow color?
Yes.
-
Ah ok in that case you can still use this solution and keep its features still available, just replace in the middle of the code this piece:
Code:
var string dlgColor; dlgColor = "";
var string dlgColorSelected; dlgColorSelected = "";
With this below:
Code:
var string dlgColor; dlgColor = "FFFF99"; //G1 standard dialog grey color C8C8C8
var string dlgColorSelected; dlgColorSelected = "FFFF33"; //White color FFFFFF
This basically defines default color of selected and 'greyed' out dialogs, I have used FFFF99 - light yellow and yellow FFFF33 to test how it looks.
Dialog instance:
[Bild: Gohic-Dialog-Colors-dialog-instance.png]
Dialog choices:
[Bild: Gothic-Dialog-Colors-dialog-choices.png]
-
Perfect! Thousand thanks!
-
Zitat von Moe
Be careful - this can't be used with dialog choices (Info_AddChoice...)
So it's not possible to simply change the font color of every dialog choice including addchoices to yellow?
Is not easiest way to change that from systempack.ini ??
Berechtigungen
- Neue Themen erstellen: Nein
- Themen beantworten: Nein
- Anhänge hochladen: Nein
- Beiträge bearbeiten: Nein
|
|