|
-
Zitat von Sektenspinner
I did not read the documentation of the package but, you seem to create a new view every time your Inicjalize_Window function is called. You open some of those views, and you close some of them, but you never act on the same view. A view that is opened will never be closed. Try something like this:
Code:
func void Inicjalize_Window(){
var int Slash_key;
if (MEM_KeyState (KEY_SLASH) != KEY_PRESSED) {
return;
};
if (Window_on == FALSE){
_SkillWindow = Print_CreateView (1000, 1000, 7000, 7000);
Print_SetViewTexture (_SkillWindow, "kartka_menu.tga");
Skill_Window_on ();
Window_on = true;
} else {
Skill_Window_off();
Window_on = false;
};
};
I would expect this code to crash when opening the view, saving, restarting Gothic and pressing Shift. This has to be fixed somehow, for example via an INIT_* function.
For this problem constants are perfect, just save the pointer in a constant
Code:
const int _SkillWindow = 0;
func void Inicjalize_Window(){
if (!viewPtr || !Window_on) {
_SkillWindow = Print_CreateView (1000, 1000, 7000, 7000);
};
var int Slash_key;
if (MEM_KeyState (KEY_SLASH) != KEY_PRESSED) {
return;
};
if (Window_on == FALSE){
Print_SetViewTexture (_SkillWindow, "kartka_menu.tga");
Skill_Window_on ();
Window_on = true;
} else {
Skill_Window_off();
Window_on = false;
};
};
Everytime Gothic is restarted, the constant is initialized with '0', therefore a new is created in Inicjalize_Window().
Geändert von Lehona (16.07.2011 um 12:18 Uhr)
-
Apprentice
Thanks you very much it's working.
-
I would prefer to load the texture after the view was created. (Print_LoadTexture isn't that fast and should be used carefully )
Code:
if (!_SkillWindow) {
_SkillWindow = Print_CreateView (1000, 1000, 7000, 7000);
Print_SetViewTexture(_SkillWindow, "kartka_menu.tga");
};
In fact, all of the view functions are quite primitive and should be updated soon. (Eg. there is no function to destroy a view or to set the intro and outro animation..)
WfG Gottfried
-
Apprentice
I'll check this but I've got last question whether it is possible to texture or letters were visible on the texture?
-
-
Apprentice
I'm talking about write something on texture by function PrintScreen.
-
Zitat von edeksumo
I'm talking about write something on texture by function PrintScreen.
Try it? And try to change the order, that might help maybe.
-
mal ne frage, könnt ihr von jedem fueture ein bild machen? Weil ich bin im scripten eine niete, denoch würde ich gerne alle funktionen sehen
-
Ich habe einen Bug entdeckt.
Undzwar:
Ich printe über einen Frametrigger mit PrintScreen(); etwas auf den Bildschirm. Wenn ich dann aber PrintS_Ext(); im Dialog aufrufe färbt sich der PrintScreen()-Text auch mit der Farbe aus der PrintS_Ext() und wenn dann der PrintS_Ext()-Text verschwunden ist wird der PrintScreen()-Text auch komplett transparent.
Der PrintScreen()-Text soll aber bleiben wie er ist, also sich nicht färben oder transparent werden.
Mfg Umfi
-
Code:
func void Hook_oCNpc__DoDropVob() {
const int oCNpc__DoDropVob = 7622096; //0x744DD0
HookEngine(oCNpc__DoDropVob, 6, "EVT_NPCDROPVOB");
};
func void EVT_NpcDropVob() {
var c_npc slf; slf = MEM_PtrToInst(ECX);
var c_item itm; itm = MEM_PtrToInst(MEM_ReadInt(ESP + 4));
PrintS(cs4(slf.name, " ließ '", itm.name, "' fallen"));
};
Ich hätte das gerne mal für Gothic I ausprobiert. Wäre jemand so freundlich und würde mir den Hexwert const int oCNpc__DoDropVob und die Byte-Länge für Gothic I raussuchen bitte? Vorausgesetzt das könnte überhaupt gehen für G1. Wasbrauche ich dafür alles? Die Enginehooks und Ikarus, oder auch LeGo?
-
-
Zitat von Der Ahnungslose
Code:
func void Hook_oCNpc__DoDropVob() {
const int oCNpc__DoDropVob = 7622096; //0x744DD0
HookEngine(oCNpc__DoDropVob, 6, "EVT_NPCDROPVOB");
};
func void EVT_NpcDropVob() {
var c_npc slf; slf = MEM_PtrToInst(ECX);
var c_item itm; itm = MEM_PtrToInst(MEM_ReadInt(ESP + 4));
PrintS(cs4(slf.name, " ließ '", itm.name, "' fallen"));
};
Ich hätte das gerne mal für Gothic I ausprobiert. Wäre jemand so freundlich und würde mir den Hexwert const int oCNpc__DoDropVob und die Byte-Länge für Gothic I raussuchen bitte? Vorausgesetzt das könnte überhaupt gehen für G1. Wasbrauche ich dafür alles? Die Enginehooks und Ikarus, oder auch LeGo?
Adresse 0x6A10F0 und 6 passt als Befehlslänge.
-
Da hat mir Sektenspinner noch etwas rausgesucht. Ein Hook für das Einsammeln / Aufsammeln von Items.
Code:
// ----- Item einsammeln -----
func void Hook_oCNpc__DoTakeVob() {
const int oCNpc__DoTakeVob = 7621056; //0x7449C0
HookEngine(oCNpc__DoTakeVob, 6, "EVT_NPCTAKEVOB");
};
func void EVT_NpcTakeVob()
{
// ----- an den NPC und das item kommen -----
var c_npc slf; slf = MEM_PtrToInst(ECX); // der NPC, der das Item einsammelt
var C_ITEM itm; itm = MEM_PtrToInst(MEM_ReadInt(ESP + 4)); // Pointer auf das Item
// ----- an den NPC und das item kommen -----
// ----- stimmt das item? -----
if (!Hlp_IsValidItem (itm))
{
return;
};
};
-
Zitat von Sektenspinner
Adresse 0x6A10F0 und 6 passt als Befehlslänge.
Danke, wird gleich ausprobiert.
-
Habt ihr jetzt eigentlich vor das Schildsystem so zu lassen oder wird das noch auf eine Variante ohne Aivars umgebaut? Bei mir geht's so naemlich nicht, weil ich alle Array-Slots voll hab und schon mehrfach nutze teilweise ^^
-
Zitat von Sektenspinner
Adresse 0x6A10F0 und 6 passt als Befehlslänge.
Zitat von Der Ahnungslose
Danke, wird gleich ausprobiert.
Es geht leider nicht! Ich hatte das hier probiert (in OwnFuncs.d):
Code:
func void Hook_oCNpc__DoDropVob() {
const int oCNpc__DoDropVob = 6951152; //0x6A10F0
HookEngine(oCNpc__DoDropVob, 6, "EVT_NPCDROPVOB");
};
func void EVT_NpcDropVob() {
var c_npc slf; slf = MEM_PtrToInst(ECX);
var c_item itm; itm = MEM_PtrToInst(MEM_ReadInt(ESP + 4));
PrintScreen ("test", -1,-1, "Font_Old_10_White_Hi.tga", 1);
//PrintS(cs4(slf.name, " ließ '", itm.name, "' fallen"));
};
und in meiner Startup:
Code:
FUNC VOID INIT_WORLD ()
{
INIT_Sub_Newcamp ();
INIT_Sub_Oldcamp ();
INIT_Sub_Psicamp ();
INIT_Sub_Demontower ();
INIT_Sub_Freeminecamp ();
INIT_Sub_Surface ();
//LeGo_Init(LeGo_AI_Function);
//LeGo_Init(LeGo_All);
var string INIT_TEST;
if(!STR_Len(INIT_TEST)) //Gothic wurde neu gestartet (sonst wäre der String befüllt)
{
INIT_TEST = "y";
// ----- Hooks setzen -----
Hook_oCNpc__DoDropVob (); //Item droppen
};
B_InitMonsterAttitudes ();
B_InitGuildAttitudes();
};
Und in meiner Gothic.src (Auszug):
Code:
ikarus\Ikarus_Const_G1.d
ikarus\EngineClasses_G1\*.d
ikarus\Ikarus.d
ikarus\Floats\*.d
//////////
// LeGo //
//////////
LeGo\AI_Function.d
LeGo\FrameFunctions.d
LeGo\Random.d
LeGo\BinaryMachines.d
LeGo\Interface.d
LeGo\Dialoggestures.d
LeGo\Focusnames.d
ikarus\Enginehooks.d
LeGo.d
ikarus\OwnFuncs.d
STORY\NPC\*.D
STORY\MISSIONS\DIA*.D
STORY\STARTUP.D
Es kommt wieder der Error Do.Stack (line 81) Fehler. Ich weiß nicht mehr weiter. Alternativ zu der Enginehooks.d hatte ich auch mal die LeGo/HookEngine.d geparst mit gleichem negativen Ergebnis. Hat noch wer eine Idee, oder soll ich aufgeben?
-
Lehrling
Hallo,
erst einmal großes Lob, das Paket ist wirklich toll.
Und schon die erste Frage, es mag zwar angesichts der vielen Skriptfragen etwas trivial wirken, aber mir ist aufgefallen, dass der Npc einen Schild am Arm immer exakt verkehrt herum hält.
(also unten ist oben und so weiter, die Seiten stimmen)
Ich wollte fragen ob es dafür eine elegantere Skript-Lösung gibt, oder ob ich zwei meshes erstellen soll und ihm sagen wann er welches zu benutzen hat?
Beste Grüße
Novize
-
Zitat von Bonne6
Habt ihr jetzt eigentlich vor das Schildsystem so zu lassen oder wird das noch auf eine Variante ohne Aivars umgebaut? Bei mir geht's so naemlich nicht, weil ich alle Array-Slots voll hab und schon mehrfach nutze teilweise ^^
Ja, das sollte in nächster Zeit machbar sein (Lehona hat schon eine Basis dafür geschaffen)
Zitat von Der Novize
Ich wollte fragen ob es dafür eine elegantere Skript-Lösung gibt, oder ob ich zwei meshes erstellen soll und ihm sagen wann er welches zu benutzen hat?
Ja, das ist derzeit noch ein Problem. Man wird vermutlich nicht drum herum kommen für jeden Schild zwei Meshes anzufertigen, wird dann aber so gelöst sein dass das System intelligent genug ist um das zweite Mesh anhand des Namens von selbst zu finden. (Eine Möglichkeit wäre zB. Mesh.3ds und Mesh_E.3ds, wobei das '_E' für 'Equipped' stehen würde)
MfG Gottfried
-
Ich werd versuchen es in meine 2te Mod einzubringe. Sieht echt alles toll aus.. Danke!
Und brauch ich bzw. ist da eine Animation für das schild dabei?
-
Wäre jemand so freundlich und würde mir mit IDA die Adressen und Bytelängen für Gothic I für folgende Aktionen raussuchen?
Waffe ziehen (in Standardtastenbelegung Leertaste)
Status/Charakterbildschirm öffnen (in Standardtastenbelegung "S")
Logbuch öffnen (in Standardtastenbelegung "L")
Schnellzugriff auf Karte (in Standardtastenbelegung "M")
nach vorne laufen (Pfeiltaste oben)
rückwärts laufen (Pfeiltaste unten)
Wenn ich wüsste, wie ich das IDA zu benutzen habe, würde ich es auch selbst machen, aber leider habe ich keine Ahnung, wie ich damit umzugehen habe.
Eine kurze Einführung in die Bedienung von IDA würde alternativ ebenso eine Hilfe sein.
Ich wäre sehr dankbar.
Berechtigungen
- Neue Themen erstellen: Nein
- Themen beantworten: Nein
- Anhänge hochladen: Nein
- Beiträge bearbeiten: Nein
|
|