-
Alles klar und vielen Dank!
-
Ich habe eine weitere Frage zum Ausgeben eines PrintScreen_Ext. Da zur Zeit leider die Seite down ist habe ich mir in der Interface-Datei folgendes angesehen:
Code:
PrintScreen_Ext(var string txt, var int x, var int y, var string font, var int timeSec)
Und dann daraus das gemacht:
Code:
Log_CreateTopic (TOPIC_WOOD_Task, LOG_MISSION);
Log_SetTopicStatus(TOPIC_WOOD_Task, LOG_RUNNING);
B_LogEntry TOPIC_WOOD_Task, "xxx.");
PrintScreen_Ext(ConcatStrings("Quest angenommen:, " TOPIC_WOOD_Task), -1, 2, FONT_ScreenSmall, 3000)
Ich möchte damit erreichen, das mein Tagebucheintrag mittig plaziert wird. Beim reparsen bekomme ich aber Zeichensetzungsfehler. Ich hab noch xx-Dinge versucht, komme aber leider auf keine passende Lösung.
Mfg
-
Das mit dem Wiki ist doof, der Gratis-Hoster unser DB taugt wohl nicht sonderlich viel Wir werden nach einer anderen Lösung suchen.
PrintScreen_Ext() ist eigentlich nicht unbedingt zur Verwendung gedacht, es macht auch nichts anderes als PrintScreen()
Gewöhn dir einfach mal an, immer die genaue Fehlermeldung zu posten (und stell sicher, dass sie sich auch genau darauf bezieht), so direkt sieht es erstmal korrekt aus.
Edit: Oder auch nicht, du hast das Semikolon am Ende vergessen.
-
Hat geklappt, danke. Aber es lang an etwas anderem.
Geändert von mobpapst (19.05.2013 um 12:52 Uhr)
-
Maybe my question seems silly, but still ask.
What instrument can overwrite the value of the constant (int, string, float)?
I understand I first need to get the address by a symbolic name. And then rewrite using the MEM_WriteXXX. Could you show an example of a few lines, or specify where to look (maybe enough to look in Ikarus.d)?
And another question. When I change the value of a constant (cost of item) with the package G2ext, the changes appear in your inventory when you save the game. Is it possible to directly produce this reinitialization after the constant changes?
I hope I have correctly written thought.
-
Code:
var zCPar_Symbol symb; symb = MEM_GetParserSymbol("SYMBNAME");
symb.content = newValue;
If it's a string, newValue must be of type zString*, ie a pointer to the string.
If you want to change the address of an instance, you will have to change symb.offset.
-
Zitat von redleha
What instrument can overwrite the value of the constant (int, string, float)?
I'd suggest using _@, _@s and _@f to get the addresses of ints, strings and floats and use MEM_WriteInt and MEM_WriteString to change the values at these addresses.
And another question. When I change the value of a constant (cost of item) with the package G2ext, the changes appear in your inventory when you save the game. Is it possible to directly produce this reinitialization after the constant changes?
The easiest way I know of would be to destroy and recreate the items or to call the intialiser Funktion for each relevant item (MEM_CallByID(ITMI_MYITEM) after setting the Instance ITMI_MYITEM appropriately and consistently specifying the instance in assignments within the initialiser function (ITMI_MYITEM.name = "My Item"; instead of name = "My Item"
In short, no, its not possible to have changes to constants affect the items that use these constants directly unless you take care of it manually.
-
Thank you, comrades.
(I corrected the example of Lehona. It was a little bit wrong. )
And another question. After changing the value of a constant effect lasts only until you restart the game. If you turn off and turn on the game, the value of constant returns. How to avoid this?
Also I will be glad if you give an example or specify the search direction.
-
Zitat von redleha
Thank you, comrades.
(I corrected the example of Lehona. It was a little bit wrong. )
And another question. After changing the value of a constant effect lasts only until you restart the game. If you turn off and turn on the game, the value of constant returns. How to avoid this?
Also I will be glad if you give an example or specify the search direction.
Woops, I forgot a _^()
Constants are loaded from the .dat file and are not stored in the savegame, with pure scripts there's no way around that.
-
Thank you, Lehona! I expected this answer to my question. But hope springs eternal.
-
Trading
Hello again. I ask this question.
Is it possible to intercept the time of transfer of the goods from NPC to NPC during trading. The subject of trade, how much money for the product, the type of currency.
That is, when we click "Ctrl" or the "left mouse button" when trading.
For example:
Code:
function tradeItem(C_ITEM item)
{
var int x; x=item.value
var int y; y= Hlp_GetInsanceID(${type_of_currency});
CreateInvItems(hero, y, item.value * TRADE_VALUE_MULTIPLIER);
};
I think it is clear why these manipulations.
The player will be able to sell expensive weapons - to arms dealer. The player will be able to sell more expensive animal trophies - to the hunter.
Geändert von redleha (24.05.2013 um 10:16 Uhr)
-
This is definitely possible, but I'll have to analyse the assembly first. I'll try to dig something up (Found the correct address already, just gotta figure out how I can access the item + the NPC at this position)
-
Alas, I've found a way to get what you need.
Code:
func void onTradeLeft() {
value = MEM_ReadInt(ESP+20); // itm.value * multiplier
MEM_WriteInt(ESP+20, 123); // set new value
var oCItem itm; itm = _^(EBX); //Get the item
var oCNpc npc; npc = _^(MEM_InformationMan.npc); // Get the NPC
};
const int oCViewDialogTrade__OnTransferLeftX = 6863312; //0x68B9D0
HookEngineF(oCViewDialogTrade__OnTransferLeftX, 6, onTradeLeft);
This should only trigger when the hero sells something, buying is a completely different (well, similar, but different) thing.
The code should be self-explaining to you, if you have questions how to use it, go ahead an ask
Edit: The value seems to be capped at about 16k (I assume around 214 but didn't check it as I thought that wouldn't matter much to you).
Geändert von Lehona (24.05.2013 um 16:11 Uhr)
-
Thank you so much! I'll try. It's better to learn new things.
PS Today I have manipulated the script by building the function that I wanted at a time when there was no Ikarus, no LeGo. But it could not be implemented.
Geändert von redleha (27.05.2013 um 15:44 Uhr)
-
So is your script working or is it not? I can't quite figure out what it's supposed to do, because that symbTable stuff looks a bit shady to me
Edit: And it's gone. Guess you don't need help.
-
Lehona
With PermMem.d (Revision 61 from SVN) in my mod stop work buttons, do not respond to cursor. At previous revisions work normal.
-
Thanks for your bug report, I will investigate tomorrow
-
This question yet. How can I get the symbolic name (a variable, a constant)?
And also, how to get a symbolic name in a function when the variable or constant is passed as a parameter.
Example:
Code:
const string AAA = "BBB"; //symbolic name = "AAA". right?
???func string GetSymbolicName_()
func string examp_1(var string x)
{
???
return symbolic_name; //must be "AAA"
};
exapm_1(AAA) = "AAA";
I kind of already know the work of memory, pointers, but sometimes difficult.
-
zCPar_Symbol has the attribute zCPar_Symbol.name, that is what you want.
The problem with your second question is that after a parameter has been pushed by the caller (ie in foo(var1) var1 will be pushed onto the stack), the callee (ie the function that is called) will pop that value from the stack into its own parameter-variables, e.g. foo(var int par1), so when the function is entered, par1 will have the value of var1. To circumvent this, you have to manipulate the bytecode in the Gothic.dat (which is entirely possible by scripts, not even too hard).
Do you have any experience with Daedalus Bytecode (zCParser.d is kind of all you need)? Don't wanna write a whole novel if you know most of the basics already anyway.
-
I know about zCPar_Symbol.name .
To circumvent this, you have to manipulate the bytecode in the Gothic.dat (which is entirely possible by scripts, not even too hard).
Do you have any experience with Daedalus Bytecode (zCParser.d is kind of all you need)? Don't wanna write a whole novel if you know most of the basics already anyway.
But in these phrases I do not understand what you mean.
In Gothic script I'm working well (5 years experience). Programming is also not alien to me. I recently started working with Ikarus and LeGo. A ASM-like scripting a bit complicated for me to start understanding. So I gradually master.
Berechtigungen
- Neue Themen erstellen: Nein
- Themen beantworten: Nein
- Anhänge hochladen: Nein
- Beiträge bearbeiten: Nein
|