|
-
Lehrling
Kann es sein, dass das Wiki seit einiger Zeit nicht mehr erreichbar ist? Ich bekomme die letzten Tage immer die Meldung
"Konnte nicht mit der Datenbank verbinden. Bitte versuche es später noch einmal."
Ist eine neue Version von LeGo geplant? Und könnte man, der Übersicht zu liebe, die diversen Werke von Usern wie Umfis Pflanzenrespawn im Ep verlinken?
-
Well then you know the answer to your first question
To track back the symbolic name of a given parameter (ie you do not want the name of the parameter ("par1") but the variable it was filled with ("var1")), you have to change the compiled code, because once the "normal" code inside a function is executed, this information is gone. You could do it like this though:
Code:
func string _getVarName() {
MEM_PopInst();
MEM_PushInst(zPAR_TOK_PUSHINT);
var int ptr; ptr = MEM_PopInt() - zCParSymbol_content_offset;
var zCPar_Symbol symb; symb = _^(ptr);
return symb.name;
};
func string getVarName(var int par) {
MEM_Error("This function should have never been entered.");
return "";
};
func void initVarName() {
MEM_ReplaceFunc(getVarName, _getVarName);
};
@Isacz: Ja, wir versuchen gerade unsere Datenbank mit dem WoG zu hosten, dann sollte die Seite wieder vernünftig stabil sein.
Edit: Verbessert.
Geändert von Lehona (28.05.2013 um 20:29 Uhr)
-
@Lehona: If I am not mistaken, a Pointer to the value is pushed not a pointer to the symbol containing the value.
Therefore your code is missing the subtraction of zCParSymbol_content_offset from ptr before following it.
-
Zitat von Sektenspinner
@Lehona: If I am not mistaken, a Pointer to the value is pushed not a pointer to the symbol containing the value.
Therefore your code is missing the subtraction of zCParSymbol_content_offset from ptr before following it.
I'm sure you've had more experience dealing with that nasty stuff I was typing that from my mind to give an idea of what it's about.
-
That was the question. How to intercept keyboard input commands. I am aware of only two possibilities: either the "Marvin" console (F2), either in the player menu - invisible symbols (where input code "Marvin").
The best way - through the console (F2). Let it swears that the input text is nonsense, but it will still run. The main thing - to get the string "[command] [parameters]"
For a start - possible or not?
P.S.
In our mod "Dark Saga" we have own console (G2Ext) and own commands. I would like to have this or a similar mechanism, made in the gothic scripts.
Geändert von redleha (29.05.2013 um 15:51 Uhr)
-
Now that's an entirely different question. You can create your own console commands, although parsing them is a bitch (Sektenspinner wrote a some kind of lexer for it, it's still really inconvenient and there isn't much you can do about it). You can also create your own console, but if you only need it for testing purposes, it's a bit over the top. If you genuinely want the player to input text, go ask Bonne6, he implemented a way to give feedback for his mod ingame.
-
I hope I have not bored you with my questions.
How to make a reinitialization of topics that appear at the beginning of the dialogue.
In fact, you can break off and start a dialogue.
If you create a condition for a line of dialogue to appear, for example, in one outer loop - this line will appear, but will not be displayed. (I tested this by pasting the code into ZS_Talk)
Code:
var int LeftShift; LeftShift = MEM_KeyState(KEY_LEFTARROW);
var int RightShift; RightShift = MEM_KeyState(KEY_RIGHTARROW);
if((LeftShift == KEY_PRESSED) && !GLOBAL_DSG_KEY_DIALOG)
{
GLOBAL_DSG_KEY_DIALOG = TRUE; //this is condition.
//At this moment the line is created, but not displayed.
//If I press Enter, the dialog will work.
};
if((RightShift == KEY_PRESSED) && GLOBAL_DSG_KEY_DIALOG)
{
GLOBAL_DSG_KEY_DIALOG = FALSE;
Print("RIGHTARROW");
};
I've been thinking that I can just hit the right place. (CallByPtr?)
Geändert von redleha (30.05.2013 um 15:44 Uhr)
-
I'm not quite sure what you mean, maybe you should try explaining it in a different way.
However, bear in mind that all AI_Output()s are called at the beginning of a dialogue. If you want to have a conditional output, the condition must be set when the player selects said dialogue.
-
I am also not sure what you mean.
When starting the Dialogue Manager, the list of available C_INFOs is built according to the conditions of the C_INFOs.
If the condition functions evaluate differently at the point when the Info is chosen by the player, unexpected behaviour may occur:
If the player picks the i-th entry in the list of infos displayed to him, then its not necessarily the i-th info in that list that will be triggered, instead the list will be built anew (without displaying it) and the i-th info in that updated list will be triggered.
Is that what you are talking about?
-
Sektenspinner - Yes, that's what I mean.
You are well understood my question. Also you have correctly described the problem.
The condition for the topic Run outside (external program or cycle) -> list of objects С_INFO in dialog_manager reconstructed, but there was no visual rebuild. And if you now click on the topic "End", functionality is executed according to another topic, the rules of which have now done.
I need to rebuild list C_INFOs.
How I can do it without leaving the dialog manager (by the reaction of the button, as I've tried it)?
-
Das LeGo-Wiki ist wieder zurück! Die Administration der WorldOfPlayers hat das Hosten des Wikis übernommen, in Zukunft sollten wir also alle von irgendwelchen Ausfällen verschont bleiben
Besonderer Dank geht an Thoronador, der uns tatkräftig beim Umzug unterstützt hat
Die neue URL ist http://lego.worldofplayers.de, allerdings wird die bisherige Adresse dorthin weiterleiten.
-
Zitat von redleha
Sektenspinner - Yes, that's what I mean.
You are well understood my question. Also you have correctly described the problem.
The condition for the topic Run outside (external program or cycle) -> list of objects С_INFO in dialog_manager reconstructed, but there was no visual rebuild. And if you now click on the topic "End", functionality is executed according to another topic, the rules of which have now done.
I need to rebuild list C_INFOs.
How I can do it without leaving the dialog manager (by the reaction of the button, as I've tried it)?
I don't know a way to do that (that does not mean that none exists).
But wouldn't it be easier to make sure that your conditions evalute consistently (most of the time)?
I can hardly think of situtions where it is unavoidable that conditions are violated that were met seconds before.
-
It's okay. If not, then not.
I just tried different ways. And looked in the direction of the class zCViewDialog(+Choice). Tried to hit on different memory addresses and parameters. I guess I just do not have the theoretical knowledge and practical knowledge that can be opened only with IDA.
-
I assume that
Code:
.text:00661AA0 protected: void __fastcall oCInformationManager::CollectInfos(void)
or
Code:
.text:00660BB0 public: void __fastcall oCInformationManager::Update(void)
could prove useful (the former more than the latter). You'll have to experiment a bit, I'm not sure whether either of those will trigger an update of the choicebox.
Edit: Do you have to experience to test those functions? If not I might give it a try when I've got free time on my hands... Which might not be in the near future.
Geändert von Lehona (04.06.2013 um 20:53 Uhr)
-
I'll try to make fun of the script, but I do not think I will come of something sensible. If I can do it, unsubscribe here.
-
Zitat von ukur
Lehona
With PermMem.d (Revision 61 from SVN) in my mod stop work buttons, do not respond to cursor. At previous revisions work normal.
I couldn't reproduce this, just did a rough test with one button and the events (enter, leave, click), they all responded properly. If you can provide more informationen I might be able to find the problem. Can you make sure it's working with an older version of PermMem.d (can you access older revisions on the SVN? If not I can give you a link)?
-
Zitat von Lehona
I couldn't reproduce this, just did a rough test with one button and the events (enter, leave, click), they all responded properly. If you can provide more informationen I might be able to find the problem. Can you make sure it's working with an older version of PermMem.d (can you access older revisions on the SVN? If not I can give you a link)?
Yes, I can access to older revisions. When I replaced current 61 build PermMem.d and LeGo.d to 59 revision this files and recompile mod scripts, all working fine. If return PermMem.d and LeGo.d from 61 revision - buttons not respond.
I tried to create a single button without additional scripts, tried to disconnect other possible additional mod scripts, as well as used in trigger script. Not yet working, some mysterious incompatibility
-
Zitat von Lehona
I assume that
Code:
.text:00661AA0 protected: void __fastcall oCInformationManager::CollectInfos(void)
or
Code:
.text:00660BB0 public: void __fastcall oCInformationManager::Update(void)
could prove useful (the former more than the latter). You'll have to experiment a bit, I'm not sure whether either of those will trigger an update of the choicebox.
Edit: Do you have to experience to test those functions? If not I might give it a try when I've got free time on my hands... Which might not be in the near future.
BRAVO! You are a very very clever man!
I solved my problem with your help. Post the code here:
Code:
func int ZS_Talk_Loop()
{
MEM_InitGlobalInst();
const int null = 0;
const int oCInformationManager__CollectInfos = 6691488;//00661AA0: protected: void __fastcall oCInformationManager::CollectInfos(void)
var int LeftArrow; LeftArrow = MEM_KeyState(KEY_LEFTARROW);
var int RightArrow; RightArrow = MEM_KeyState(KEY_RIGHTARROW);
if((LeftArrow== KEY_PRESSED) && !GLOBAL_DSG_KEY_DIALOG)
{
GLOBAL_DSG_KEY_DIALOG = TRUE;
CALL__fastcall(MEM_InstToPtr(MEM_InformationMan),_@(null),6691488);
};
if((RightArrow== KEY_PRESSED) && GLOBAL_DSG_KEY_DIALOG)
{
GLOBAL_DSG_KEY_DIALOG = FALSE;
CALL__fastcall(MEM_InstToPtr(MEM_InformationMan),_@(null),6691488);
};
[...]
};
But I just had to know what address to hit, and what type of function (this, std, fast).
Geändert von redleha (05.06.2013 um 11:54 Uhr)
-
Today tried to make two functions, being based on it:
Code:
oCMobContainer:: Remove (oCItem *) 00725FF0 87
oCMobContainer:: Remove (oCItem *, int) 00726080 103
I thought that the first function deletes 1 item, the second function - N (int) items.
Has written this:
Code:
const int oCMOB_Container__RemoveItem = 7495664; //00725FF0
const int oCMOB_Container__RemoveItems = 7495808; //00726080
func void Mob_RemoveItem (var int mobPtr, var C_ITEM instName)
{
CALL_PtrParam (MEM_InstToPtr (instName));
CALL__thiscall (mobPtr, oCMOB_Container__RemoveItem);
};
func void Mob_RemoveItems (var int mobPtr, var C_ITEM instName, var int count)
{
CALL_IntParam (count);
CALL_PtrParam (MEM_InstToPtr (instName));
CALL__thiscall (mobPtr, oCMOB_Container__RemoveItems);
};
Called so:
Code:
func void player_hotkey_lame_heal ()
{
var oCNpc her; her = Hlp_GetNpc (hero);
if (Hlp_Is_oCMobContainer (her.focus_vob))
{
Mob_RemoveItems(her.focus_vob,ItMi_Gold,1);
//or
//Mob_RemoveItem(her.focus_vob,ItMi_Gold);
};
};
In a chest there are 100 coins and 150 arrows. In any of two cases all coins are deleted. Why?
-
I don't think it is that simple. oCMOB_Container::RemoveItem does not expect a pointer to any Gold coin but to the specific Gold coin in the cointainer you want to remove. I think you need to operate on oCMobContainer.containList.
Also, calling RemoveItem does not destroy the item but expects you to use the item somewhere, for example as a vob in the world (in other words, your code leaks one item, therefore wasting memory).
While all I am saying may illustrate how your code is problematic in general, it does not explain your symptoms. I have no idea why all of the coins would vanish.
Berechtigungen
- Neue Themen erstellen: Nein
- Themen beantworten: Nein
- Anhänge hochladen: Nein
- Beiträge bearbeiten: Nein
|
|