|
-
Neuling
Jop, ist alles korrekt installiert.
Wir konnten es inzwischen darauf begrenzen, dass die Spieler in ihren Systemsteuerungen die Datenausführungsverhinderung für die Gothic2.exe freigeben müssen. Ist in die Richtung etwas bekannt? Weil dies müssen ganz offensichtlich nicht alle Spieler machen.
-
Datenausführungsverhinderung für gothic2.exe deaktivieren ist zwingend notwendig, einfach auf Grund dessen wie Ikarus funktioniert.
Falls ein Spieler Union verwendet, muss er das nicht manuell machen. Union kümmert sich da irgendwie automatisch drum.
-
Zitat von KnightGotha
Jop, ist alles korrekt installiert.
Wir konnten es inzwischen darauf begrenzen, dass die Spieler in ihren Systemsteuerungen die Datenausführungsverhinderung für die Gothic2.exe freigeben müssen. Ist in die Richtung etwas bekannt? Weil dies müssen ganz offensichtlich nicht alle Spieler machen.
Üblicherweise ist die DEP (Datenausführungsverhinderung) nur für Systemprozesse aktiviert, deswegen müssen die meisten Leute keine gesonderten Einstellungen vornehmen. Warum das bei einigen Systemen anders ist, weiß ich leider nicht.
-
Sektenspinner, why are you used here flag instead ?
Script about blocking menu item:
https://forum.worldofplayers.de/foru...1#post12449815
Sektenspinner, or maybe anyone else knows the answer?
-
topic has entry condition
Hi! Can anybody help to modify the code to make condition - if the topic has already any entry or not.
-
Code:
func int Log_GetTopicStatus(var string topic) {
var zCList list; list = _^(Log_GetLogManager_Ptr);
//new
//
while (list.next);
list = _^(list.next);
if (list.data) {
if (Hlp_StrCmp(MEM_ReadString(list.data), topic)) {
return MEM_ReadInt(list.data +24); // oCLogTopic.m_enuSection, oCLogTopic class doesn't exist in g1
//return MEM_ReadInt(list.data +20); // do log_note or log_mission
//new
var zCList logManagerList; logManagerList = _^(oCLogManager_Ptr);
var zCList topicNode;
var zCList nextTopicNode;
//list = _^(oCLogManager.m_lstEntries_next);
if (nextTopicNode == 1) {
};
//new
};
};
end;
return -1;
};
-
Hello pawbuj,
Here is an example (requires Ikarus) that will demonstrate how you can work with oCLogTopic entries (what you are looking for is function Log_GetNoOfEntries):
Code:
const int LOG_STATUS_INVALID = -1;
//const int LOG_DEFAULT = 0;
//const int LOG_RUNNING = 1;
//const int LOG_SUCCESS = 2;
//const int LOG_FAILED = 3;
//const int LOG_OBSOLETE = 4;
const int LOG_SECTION_INVALID = -1;
//const int LOG_MISSION = 0;
//const int LOG_NOTE = 1;
func int Log_GetTopic (var string topicName) {
var zCList l;
var int list; list = oCLogManager_Ptr;
while (list);
l = _^ (list);
if (l.data) {
var oCLogTopic logTopic; logTopic = _^ (l.data);
if (Hlp_StrCmp (logTopic.m_strDescription, topicName)) {
return l.data;
};
};
list = l.next;
end;
return 0;
};
func int Log_GetTopicStatus (var string topicName) {
var int ptr; ptr = Log_GetTopic (topicName);
if (!ptr) { return LOG_STATUS_INVALID; };
var oCLogTopic logTopic; logTopic = _^ (ptr);
return logTopic.m_enuStatus;
};
func int Log_GetTopicSection (var string topicName) {
var int ptr; ptr = Log_GetTopic (topicName);
if (!ptr) { return LOG_SECTION_INVALID; };
var oCLogTopic logTopic; logTopic = _^ (ptr);
return logTopic.m_enuSection;
};
func int Log_GetNoOfEntries (var string topicName) {
var int ptr; ptr = Log_GetTopic (topicName);
if (!ptr) { return 0; };
var oCLogTopic logTopic; logTopic = _^ (ptr);
if (!logTopic.m_lstEntries_next) { return 0; };
var zCList l;
var int list; list = logTopic.m_lstEntries_next;
var int count; count = 0;
while (list);
l = _^ (list);
if (l.data) {
count += 1;
};
list = l.next;
end;
return count;
};
func string Log_GetEntryByIndex (var string topicName, var int index) {
var int ptr; ptr = Log_GetTopic (topicName);
if (!ptr) { return ""; };
var oCLogTopic logTopic; logTopic = _^ (ptr);
if (!logTopic.m_lstEntries_next) { return ""; };
var zCList l;
var int list; list = logTopic.m_lstEntries_next;
var int count; count = 0;
while (list);
l = _^ (list);
if (l.data) {
if (count == index) {
var string entry; entry = MEM_ReadString (l.data);
return entry;
};
count += 1;
};
list = l.next;
end;
return "";
};
func void testLog () {
const string CH1_TEST = "TEST";
Log_CreateTopic (CH1_TEST, LOG_MISSION);
Log_SetTopicStatus (CH1_TEST, LOG_RUNNING);
Log_AddEntry (CH1_TEST, "This is just a test.");
Log_AddEntry (CH1_TEST, "This is second entry.");
Log_AddEntry (CH1_TEST, "This is another entry.");
var int count; count = Log_GetNoOfEntries (CH1_TEST);
repeat (i, count); var int i;
var string entry; entry = Log_GetEntryByIndex (CH1_TEST, i);
PrintS (entry);
end;
};
Hope this helps
-
Faw works great - manythanx for it , however only missed me one func which is return int as a number of entries in selected topic.
-
Ah ok, I think I know what you are looking for now - no of topics in a specific section (e.g. how many LOG_RUNNING topics are in LOG_MISSION section):
This function should give you number of topics in specified section with specified status:
Code:
func int Log_GetNoOfTopics(var int logSection, var int logStatus) {
var zCList l;
var int list; list = oCLogManager_Ptr;
var int count; count = 0;
while (list);
l = _^ (list);
if (l.data) {
var oCLogTopic logTopic; logTopic = _^ (l.data);
if ((logTopic.m_enuSection == logSection) || (logSection == -1)) {
if ((logTopic.m_enuStatus == logStatus) || (logStatus == -1)) {
count += 1;
};
};
};
list = l.next;
end;
return count;
};
Note: use parameter -1 if you don't want to filter for section / status.
-
Zitat von F a w k e s
Ah ok, I think I know what you are looking for now - no of topics in a specific section (e.g. how many LOG_RUNNING topics are in LOG_MISSION section):
This function should give you number of topics in specified section with specified status:
Code:
func int Log_GetNoOfTopics(var int logSection, var int logStatus) {
var zCList l;
var int list; list = oCLogManager_Ptr;
var int count; count = 0;
while (list);
l = _^ (list);
if (l.data) {
var oCLogTopic logTopic; logTopic = _^ (l.data);
if ((logTopic.m_enuSection == logSection) || (logSection == -1)) {
if ((logTopic.m_enuStatus == logStatus) || (logStatus == -1)) {
count += 1;
};
};
};
list = l.next;
end;
return count;
};
Note: use parameter -1 if you don't want to filter for section / status.
many thanx , great !!!
-
adding sound to mover
Can anybody help to add voice for movers from script level.
Here is the code Itried to call
Code:
FUNC VOID GATES_SFX(){
//var oCMobInter mob; mob = _^ (MEM_SearchVobByName("EVT_OC_MAINGATE01_SWITCH"));
var zCMover mov1; mov1 = _^ (MEM_SearchVobByName ("EVT_OC_MAINGATE01_01"));
var zCMover mov2; mov2 = _^ (MEM_SearchVobByName ("EVT_OC_MAINGATE02_02"));
var zCMover mov3; mov3 = _^ (MEM_SearchVobByName ("EVT_OW_STARTLOCKER_MOVER"));
var zCMover mov4; mov4 = _^ (MEM_SearchVobByName ("EVT_OC_INNERMAINGATE"));
var oCMobInter mob; mob = _^ (MEM_SearchVobByName("CHEST"));
mov1.sfxOpenStart = "GATE_WOODEN_O1";
mov1.sfxCloseStart = "GATE_WOODEN_O1";
mov2.sfxOpenStart = "GATE_WOODEN_O2";
mov2.sfxCloseStart = "GATE_WOODEN_O2";
mov3.triggerTarget = "EVT_STARTLOCKER_MOVER";
mov3.sfxOpenStart = "GATE_WOODEN_O3";
mov3.sfxCloseStart = "GATE_WOODEN_O3";
mov4.sfxOpenStart = "GATE_START";
mov4.sfxMoving = "GATE_LOOP";
mov4.sfxOpenEnd = "GATE_STOP";
mov4.sfxCloseStart = "GATE_START";
mov4.sfxCloseStart = "GATE_START";
-
Hello pawbuj,
If you are using Ikarus class definitions - then your properties are not correct.
For example zCMover does not have .sfxOpenStart but it's named .soundOpenStart:
Code:
func void GATES_SFX(){
//var oCMobInter mob; mob = _^ (MEM_SearchVobByName("EVT_OC_MAINGATE01_SWITCH"));
var zCMover mov1; mov1 = _^ (MEM_SearchVobByName ("EVT_OC_MAINGATE01_01"));
var zCMover mov2; mov2 = _^ (MEM_SearchVobByName ("EVT_OC_MAINGATE02_02"));
var zCMover mov3; mov3 = _^ (MEM_SearchVobByName ("EVT_OW_STARTLOCKOUT_MOVER")); //EVT_OW_STARTLOCKER_MOVER
var zCMover mov4; mov4 = _^ (MEM_SearchVobByName ("EVT_OC_INNERMAINGATE"));
//var oCMobInter mob; mob = _^ (MEM_SearchVobByName("CHEST"));
mov1.soundOpenStart = "GATE_WOODEN_O1";
mov1.soundCloseStart = "GATE_WOODEN_O1";
mov2.soundOpenStart = "GATE_WOODEN_O2";
mov2.soundCloseStart = "GATE_WOODEN_O2";
mov3._zCTrigger_triggerTarget = "EVT_STARTLOCKER_MOVER";
mov3.soundOpenStart = "GATE_WOODEN_O3";
mov3.soundCloseStart = "GATE_WOODEN_O3";
mov4.soundOpenStart = "GATE_START";
mov4.soundMoving = "GATE_LOOP";
mov4.soundOpenEnd = "GATE_STOP";
mov4.soundCloseStart = "GATE_START";
mov4.soundCloseStart = "GATE_START";
};
Couple more notes:
- in vanilla G1 I haven't found EVT_OW_STARTLOCKER_MOVER (so for testing I have renamed it to EVT_OW_STARTLOCKOUT_MOVER - just FYI.
- in vanilla G1 there is no sound GATE_WOODEN - I assume you have added this by yourself.
- I have noticed sounds for GATE_WOODEN_ don't have number there but letter O - something that might potentially be an issue
-
Hi Faw everything works fine beyond triggertarget. Am i doing something wrong ?
Code:
mov3._zCTrigger_triggerTarget = "EVT_OW_LOCKOUT_TRIGGER";
-
Double-checked now vanilla world - it seems like winch name is EVT_OW_LOCKOUT_TRIGGER and mover name is EVT_OW_LOCKOUT_MOVER.
In vanilla winch.triggertarget is 'disabled' (triggerTarget property has string '//EVT_OW_LOCKOUT_MOVER') and does not work.
If you want to use scripts to update this trigger - you should try something like this:
Code:
var zCTrigger trg; trg = _^ (MEM_SearchVobByName ("EVT_OW_LOCKOUT_TRIGGER"));
trg.triggerTarget = "EVT_OW_LOCKOUT_MOVER";
-
I made it working by one signifficant change - it can't be zcTrigger, must be ocMobInter.
Code:
var oCMobInter trg; trg = _^ (MEM_SearchVobByName ("EVT_OW_LOCKOUT_TRIGGER"));
trg.triggerTarget = "EVT_OW_STARTLOCKOUT_MOVER";
Geändert von pawbuj (14.02.2023 um 09:37 Uhr)
-
cinema scope in G1
Hello everyone
I found some nice code working as a cinema scope in G2, however I get crash every time I would like to use for G1. Maybe someone knows the reason.
Code:
/* * Abruf
*/
func void Ninja_CinemaScope_Main() {
var int ptr;
var int tmp;
var int CinemaScopeAlpha;
MEM_GAME.array_view_visible[3] = true;
MEM_GAME.array_view_enabled[3] = true;
MEM_Camera.cinemaScopeEnabled = true;
MEM_Camera.cinemaScopeColor = RGBA (0, 0, 0, CinemaScopeAlpha);
//Fade Effekt
if (InfoManager_HasFinished())
{
if (CinemaScopeAlpha >= 5) {
CinemaScopeAlpha -= 10;
};
if (CinemaScopeAlpha == 5) {
CinemaScopeAlpha = 0;
};
} else {
if (CinemaScopeAlpha <= 250) {
CinemaScopeAlpha += 10;
};
if (CinemaScopeAlpha == 250) {
CinemaScopeAlpha = 255;
};
};
//Holen der Text Boxen
ptr = MEM_InstGetOffset (MEM_GAME)+52; //?
ptr = MEM_ReadInt (ptr);
ptr = ptr+64;
MEM_WriteInt (ptr, 0);
ptr = MEM_InstGetOffset (MEM_GAME)+60;
ptr = MEM_ReadInt (ptr);
ptr = ptr+4;
MEM_WriteInt (ptr, 0);
ptr = ptr+12;
MEM_WriteInt (ptr, 1);
ptr = MEM_ReadInt (MEMINT_oCInformationManager_Address+28);
MEM_WriteInt (ptr+56, STR_ToInt (MEM_GetGothOpt ("VIDEO", "zVidResFullscreenX"))/6);
ptr = ptr+60;
//Neu Positionierung und in Speicher schreiben
if (Print_Screen[PS_Y] <= 768) { //low res fix
tmp = Print_Screen[PS_Y] * 21 / 2 - ((Print_Screen[PS_Y] * 2 / 24) % 1);
MEM_WriteInt (ptr, tmp);
ptr = ptr+8;
MEM_WriteInt (ptr, Print_Screen[PS_Y] - tmp);
} else {
tmp = Print_Screen[PS_Y] * 113 / 128;
tmp = tmp - (tmp % 1);
if (Print_Screen[PS_Y] - tmp > 120) {
tmp = tmp + (Print_Screen[PS_Y] - tmp - 120) / 8; //Held Fragen Postion Y
tmp = tmp - (tmp % 1);
MEM_WriteInt (ptr, tmp);
ptr = ptr+8;
MEM_WriteInt (ptr, 120);
} else {
MEM_WriteInt (ptr, tmp);
ptr = ptr+8;
MEM_WriteInt (ptr, Print_Screen[PS_Y] - tmp);
};
};
ptr = ptr+28;
MEM_WriteInt (ptr, 0);
};
-
This code is crashing because it is working with offsets. G2 NoTR has different offsets than G1 - therefore this code is incompatible and crashing ...
If you want to use this code in G1 you have to 'reverse engineer' what the code is doing and adjust pointer offsets. Or you can rewrite it to compatible version. (e.g. by using objects instead of pointers [assuming you have all required class definitions])
Little 'reverse-engineering':
Code:
ptr = MEM_InstGetOffset (MEM_GAME)+52;
ptr = MEM_ReadInt (ptr);
ptr = ptr+64;
MEM_WriteInt (ptr, 0);
Let's figure out first part - pointer (MEM_Game + offset 52). If you look at class definition for object MEM_Game (in Ikarus) - you can see that offset 52 points to oCGame.array_view[GAME_VIEW_CONVERSATION]:
Code:
class oCGame {
var int _vtbl; //0
var int _zCSession_csMan; //4
var int _zCSession_world; //8
var int _zCSession_camera; //12
var int _zCSession_aiCam; //16
var int _zCSession_camVob; //20
var int _zCSession_viewport; //24
var int cliprange; //28
var int fogrange; //32
var int inScriptStartup; //36
var int inLoadSaveGame; //40
var int inLevelChange; //44
/*
enum oTGameDialogView
{
GAME_VIEW_SCREEN ,
GAME_VIEW_CONVERSATION ,
GAME_VIEW_AMBIENT ,
GAME_VIEW_CINEMA ,
GAME_VIEW_CHOICE ,
GAME_VIEW_NOISE ,
GAME_VIEW_MAX
}*/
//Views sind Kanäle, über die die Engine
//Informationen anzeigen kann.
//Beispiel sind die normalen Dialoguntertitelboxen.
var int array_view[GAME_VIEW_MAX]; //zCView*
//var int array_view[GAME_VIEW_SCREEN]; //48
//var int array_view[GAME_VIEW_CONVERSATION]; //52
Now second part:
Code:
ptr = MEM_InstGetOffset (MEM_GAME)+52;
ptr = MEM_ReadInt (ptr);
ptr = ptr+64;
MEM_WriteInt (ptr, 0);
This is pointer to (zCView + 64) - again if we check class definition in Ikarus, we can see that this points to oCGame.array_view[GAME_VIEW_CONVERSATION].owner:
Code:
class zCView {
var int _vtbl; //0
var int _zCInputCallBack_vtbl; //4
/*
enum zEViewFX
{
VIEW_FX_NONE,
VIEW_FX_ZOOM,
VIEW_FX_MAX
}*/
var int m_bFillZ; //8
var int next; //12
//enum zTviewID { VIEW_SCREEN,VIEW_VIEWPORT,VIEW_ITEM };
var int viewID; //16
var int flags; //20
var int intflags; //24
var int ondesk; //28
/*
enum zTRnd_AlphaBlendFunc { zRND_ALPHA_FUNC_MAT_DEFAULT,
zRND_ALPHA_FUNC_NONE,
zRND_ALPHA_FUNC_BLEND,
zRND_ALPHA_FUNC_ADD,
zRND_ALPHA_FUNC_SUB,
zRND_ALPHA_FUNC_MUL,
zRND_ALPHA_FUNC_MUL2,
zRND_ALPHA_FUNC_TEST,
zRND_ALPHA_FUNC_BLEND_TEST
}; */
var int alphafunc; //32
var int color; //36
var int alpha; //40
// Childs
//zList <zCView> childs
var int childs_compare; //44
var int childs_count; //48
var int childs_last; //52
var int childs_wurzel; //60
var int owner; // 64 zCView*
Finally you can re-write it to 'G1 / G2 compatible' code by using objects - instead of pointers:
Code:
//ptr = MEM_InstGetOffset (MEM_GAME)+52;
//ptr = MEM_ReadInt (ptr);
//ptr = ptr+64;
//MEM_WriteInt (ptr, 0);
const int GAME_VIEW_CONVERSATION = 1;
var zCView v;
v = _^ (MEM_GAME.array_view [GAME_VIEW_CONVERSATION]);
v.owner = 0;
Hopefully you get an idea from above example how to proceed ... if you continue with this approach you will get to working solution for sure
(this is just to give you an idea what to do - it's not a working solution)
Geändert von F a w k e s (25.02.2023 um 15:18 Uhr)
-
I had some time now, so I continued with 'reverse-engineering' & identified all properties which are changed by pointers in the code below:
Code:
/* Abruf */
func void Ninja_CinemaScope_Main() {
var int ptr;
var int tmp;
var int CinemaScopeAlpha;
MEM_GAME.array_view_visible[3] = true;
MEM_GAME.array_view_enabled[3] = true;
MEM_Camera.cinemaScopeEnabled = true;
MEM_Camera.cinemaScopeColor = RGBA (0, 0, 0, CinemaScopeAlpha);
//Fade Effekt
if (InfoManager_HasFinished())
{
if (CinemaScopeAlpha >= 5) {
CinemaScopeAlpha -= 10;
};
if (CinemaScopeAlpha == 5) {
CinemaScopeAlpha = 0;
};
} else {
if (CinemaScopeAlpha <= 250) {
CinemaScopeAlpha += 10;
};
if (CinemaScopeAlpha == 250) {
CinemaScopeAlpha = 255;
};
};
//Holen der Text Boxen
ptr = MEM_InstGetOffset (MEM_GAME)+52; //oCGame.array_view[GAME_VIEW_CONVERSATION] //zCView*
ptr = MEM_ReadInt (ptr);
ptr = ptr+64; //oCGame.array_view[0].owner //zCView*
MEM_WriteInt (ptr, 0);
ptr = MEM_InstGetOffset (MEM_GAME)+60; //oCGame.array_view[GAME_VIEW_CINEMA] //zCView*
ptr = MEM_ReadInt (ptr);
ptr = ptr+4; //oCGame.array_view[GAME_VIEW_CINEMA]._zCInputCallBack_vtbl
MEM_WriteInt (ptr, 0);
ptr = ptr+12; //oCGame.array_view[GAME_VIEW_CINEMA].viewID //enum zTviewID { 0 - VIEW_SCREEN, 1 - VIEW_VIEWPORT, 2 - VIEW_ITEM };
MEM_WriteInt (ptr, 1);
ptr = MEM_ReadInt (MEMINT_oCInformationManager_Address+28); //oCInformationManager.DlgChoice //zCViewDialogChoice*
MEM_WriteInt (ptr+56, STR_ToInt (MEM_GetGothOpt ("VIDEO", "zVidResFullscreenX"))/6); //oCInformationManager.DlgChoice.virtualSizeY
ptr = ptr+60; //oCInformationManager.DlgChoice.textureAlpha
//Neu Positionierung und in Speicher schreiben
if (Print_Screen[PS_Y] <= 768) { //low res fix
tmp = Print_Screen[PS_Y] * 21 / 2 - ((Print_Screen[PS_Y] * 2 / 24) % 1);
MEM_WriteInt (ptr, tmp); //oCInformationManager.DlgChoice.textureAlpha
ptr = ptr+8; //oCInformationManager.DlgChoice.texturePosition_0[1]
MEM_WriteInt (ptr, Print_Screen[PS_Y] - tmp);
} else {
tmp = Print_Screen[PS_Y] * 113 / 128;
tmp = tmp - (tmp % 1);
if (Print_Screen[PS_Y] - tmp > 120) {
tmp = tmp + (Print_Screen[PS_Y] - tmp - 120) / 8; //Held Fragen Postion Y
tmp = tmp - (tmp % 1);
MEM_WriteInt (ptr, tmp); //oCInformationManager.DlgChoice.textureAlpha
ptr = ptr+8; //oCInformationManager.DlgChoice.texturePosition_0[1]
MEM_WriteInt (ptr, 120);
} else {
MEM_WriteInt (ptr, tmp); //oCInformationManager.DlgChoice.textureAlpha
ptr = ptr+8; //oCInformationManager.DlgChoice.texturePosition_0[1]
MEM_WriteInt (ptr, Print_Screen[PS_Y] - tmp);
};
};
ptr = ptr+28; //oCInformationManager.DlgChoice.durationOpen
MEM_WriteInt (ptr, 0);
};
Seems like code is working with class zCViewDialogChoice --> which is unfortunatelly not available in Ikarus.
If you want to try to re-write this code by yourself (I highly encourage you to do it) you can find class definition here:
https://github.com/auronen/AF-Script...og.d#L643-L737
-
If you don't want to try it by yourself - here is 'compatible' version which should work ib both G1 & G2 NoTR (if you have correct class definitions):
-
Can i use the Code? The Patch (not the Code) is from me xD
-
Hi Faw . It works many thanx for it.
Which part of code is responsible for chaninging size of cinemascope effect. A small part of the the text (1-2 lines
) of dlgchoice and npc dialog box is beyond cinema faded screen.
Geändert von pawbuj (28.02.2023 um 12:46 Uhr)
Berechtigungen
- Neue Themen erstellen: Nein
- Themen beantworten: Nein
- Anhänge hochladen: Nein
- Beiträge bearbeiten: Nein
|
|