PDA

Archiv verlassen und diese Seite im Standarddesign anzeigen : I need aid about scripting, please



Kheiron
30.01.2008, 00:26
I need aid about scripting.

I’m not able to programme anything and, of course, I don’t thirst for learn it now, but my purpose is very simple: I wish to revise few data (numbers and names) into Gothic’s and Gothic2’s scripts, in order to rebalance both games.

I use the original italian scripts (instead of the official german modkit or the McDullen’s english pack), because I don’t want to go without the italian translation. I extracted the italian scripts by Gothic Sourcer 3.14 and, of course, it found out many errors §cry (but few different kinds of them).
In order to solve the errors, I read some threads and the GS314 guide, but it wasn’t enough. I compared the incorrect italian scripts to the german ones and to the english ones, but it wasn’t enough again §wall.

So I hope someone has a look at my few incorrect scripts and solves them; I could send the specific data by email. Of course, I need only the solutions about critical errors and maybe the explanations about few samples will be enough; then I will finish the work.

Thanks in advance.

WernerTWC
30.01.2008, 19:05
I extracted the italian scripts by Gothic Sourcer 3.14 and, of course, it found out many errors §cry (but few different kinds of them).
You can find those errors by yourself, i did it with english extracted scripts like this:

http://forum.worldofplayers.de/forum/showthread.php?p=4590109&#post4590109


I modified the Gothic.src, so that every line was there twice, that made it possible to locate the errors through the zSpy-messages.

You could use this (attached) gothic.src (this is for g2/notr):

Kheiron
30.01.2008, 23:53
Thanks, WernerTWC, but I already know your English Cleaned Script Pack and it's not what I need :(

Infact you wrote ...

They are for the case you create an own, new modification, apart from the NotR (plus classic) story.
I.e. NPCs from g2 (notr) are missing, because they are not needed anymore when you create a new mod with new NPCs and dialogs, that helps to save a lot of time when you rewrite the Output-Units.

My last post explained ...

I wish to revise few data (numbers and names) into Gothic’s and Gothic2’s scripts, in order to rebalance both games
besides ...

I use the original italian scripts (instead of the official german modkit or the McDullen’s english pack), because I don’t want to go without the italian translation
and at last ...

I compared the incorrect italian scripts to the german ones and to the english ones, but it wasn’t enough again

For example, some incorrect scripts are into the Story/Dialoge folder, but your analogue folder is nearly empty.

I will wait again :rolleyes:

Kheiron
31.01.2008, 00:00
Don't be afraid.

All data are ready. I presume the work will require few minutes, if you have a basic knowledge of programming.

Please :gratz

WernerTWC
31.01.2008, 01:32
Thanks, WernerTWC, but I already know your English Cleaned Script Pack and it's not what I need :(
Sorry, i think you got me wrong,... i understood you don't need the english cleaned up scripts,... (i mentioned these cleaned up scripts just as an example).
If i understood you correctly, you have extracted the scripts with the gothic sourcer, i did the same with english scripts for that cleaned up scripts. ... I extracted the english scripts and had to correct them manually, the "trick" with the modified gothic.src works, just test it (reparse the scripts with that gothic.src and check the zspy messages, it will show you the name and the line the error is in).

Kheiron
31.01.2008, 23:40
Mmmm ... my terrible English is a serious problem, I know that §wink

I try to explain again.

GS314 specified to me the problematical scripts, the relative incorrect lines and the kinds of error. Of course, I noted all warnings, I consulted the specific paragraph into the GS314 guide, I compared my italian incorrect scripts and the analogue german and english ones; infact I wished to correct the errors manually by myself.
Unfortunately some errors are also in the original german and english scripts and, besides, the GS314 guide isn't very explicit; so I can't imagine the right lines, because I haven't a knowledge of program languages §weissnich. So, I presume ZSpy can't help me.

Anyway, I prepared a text with some abstracts from the incorrect scripts and the relative warnings from GS314. There's all you need to solve my problems in few minutes.
I could write the whole text into this thread by few posts, if you prefer like this; anyone could intervene easily about one or more errors :rolleyes:

WernerTWC
01.02.2008, 00:10
Mmmm ... my terrible English is a serious problem, I know that §wink
No problem. :)


GS314 specified to me the problematical scripts, the relative incorrect lines and the kinds of error.
Here are 2 errors, first: Forget about the warnings the gothic sourcer gives you.
Second: The lines and scripts are not named correctly until you use that modified gothic.src, after that you can easily read which script and in which line of that script the error is in (in the zspy).

BTW.: To see in which line of the script you are, use a text-editor like Crimson-Editor, it's freeware and can show you the line numbers.



Anyway, I prepared a text with some abstracts from the incorrect scripts and the relative warnings from GS314. There's all you need to solve my problems in few minutes.
I could write the whole text into this thread by few posts, if you prefer like this; anyone could intervene easily about one or more errors :rolleyes:
You could pack your text to a WinRAR-archive, upload it here and post it:
http://upload.worldofplayers.de/upload.cgi?

(If it's not too big, just post it).

Kheiron
01.02.2008, 00:54
Well ... so I will start my personal war against ZSpy §kratz

I will come back tomorrow §gn8

Kheiron
12.02.2008, 22:53
Sorry for my absence during last week.

Finally I corrected some scripts and I compiled all them by the WernerTWC’s modified “.src” file; zSpy reported no critical error and the process was successful. Actually I’m able to compile the scripts with the usual “.src” files by the Gothic Starter Mod.

However I’m doubtful about the presumed fallibility of GS314 §kratz; really the reported lines appear incorrect. It reported also some incorrect Italian lines and the comparison between them and the equivalent German ones confirms the errors.
Maybe the reported errors appear negligible to the game engine, but I wish to discover their solutions in order to be unworried. Besides I prefer to use GS314 during the testing of my mods, instead of the Gothic Starter Mod.
So last weekend I compared (very carefully) the incorrect scripts to the similar correct ones and I found their probable solutions :cool:.

Again I hope someone has a look at the next “.doc” file and confirms or rectifies my suppositions.

Gothic incorrect scripts.zip (http://upload.worldofplayers.de/files/Gothic incorrect scripts.zip)

There are the abstracts from only 23 incorrect scripts, the relative warnings by GS314 and, most of all, my suppositions. In order to make your work easier, the abstracts are copied from the English scripts, instead of the Italian ones. Really there's all you need to solve my doubts in few minutes.
When all doubts will be solved, I will add every final solution into the previous “.doc” file and I will release it here. Maybe it will be useful to someone.

Kheiron
12.02.2008, 23:02
Anyway my main doubts are only the few next ones (the ".doc" text, which is into the previous ".rar" file, is more clear).




G2 Story\Dialoge\Dia_Sld_810_Dar.d(245)
Error: Comparison is possible only in ‘if’ expression

func int DIA_Dar_Kameradenschwein_Condition()
{
if(Dar_LostAgainstCipher == TRUE)
{
self.aivar[AIV_LastFightComment] == FALSE; //geht NUR bei ECHTER Important-Info!
return TRUE;
};
};

Maybe I should replace the previous paragraph by the next one:

func int DIA_Dar_Kameradenschwein_Condition()
{
if((Dar_LostAgainstCipher == TRUE) && (self.aivar[AIV_LastFightComment] == FALSE))
{
return TRUE;
};
};

Unfortunately I can imagine no solution about the cryptic German line.




G2 Story\Dialoge\DIA_PC_Thief_NW.d(284)
Error: Cannot convert from type int to instance

[ … … …]

if(Npc_HasItems(other,ItSe_DiegosTreasure_Mis) >= 1)
{
B_GiveInvItems(other,self,ItSe_DiegosTreasure_Mis,1);
b_diegonw_diegosrevenge();
DiegosRevenge = TRUE;
}
else if(Npc_HasItems(other,ItMi_Gold < DiegosTreasure))
{
AI_Output(self,other,"DIA_DiegoNW_HaveYourGold_11_02"); //But that's not all of it! Don't you trust me? I need the entire sum.
AI_Output(self,other,"DIA_DiegoNW_HaveYourGold_11_03"); //If my plan works out, there will be enough left over for you.
AI_Output(self,other,"DIA_DiegoNW_HaveYourGold_11_04"); //So make sure that I get the whole amount. It's important!
}
else
{
B_GiveInvItems(other,self,ItMi_Gold,DiegosTreasure);
b_diegonw_diegosrevenge();
DiegosRevenge = TRUE;
};

[ … … …]

Maybe I should replace the incorrect line by the next one:

else if(Npc_HasItems(other,ItMi_Gold) < DiegosTreasure)




G1 AI\ZS_Human\ZS_WaitForPassage.d(27)
Error: Function should return value

func int ZS_WaitForPassage_Loop()
{
PrintDebugNpc(PD_ZS_LOOP,"ZS_WaitForPassage_Loop");
if(Npc_IsWayBlocked(self))
{
}
else
{
PrintDebugNpc(PD_ZS_Check,"...Weg nicht mehr geblockt!");
return 1;
};
AI_Wait(self,0.5);
};

Maybe I should add the “return 0” command above the last line.

Anyway the next paragraph appears more appropriate than the previous one:

func int ZS_WaitForPassage_Loop()
{
PrintDebugNpc(PD_ZS_LOOP,"ZS_WaitForPassage_Loop");
if(Npc_IsWayBlocked(self))
{
return LOOP_CONTINUE;
}
else
{
PrintDebugNpc(PD_ZS_Check,"...Weg nicht mehr geblockt!");
return LOOP_END;
};
AI_Wait(self,0.5);
};




G1 Magic\Spell_ProcessMana.d(187)
Error: Function should return value

func int Spell_ProcessMana(var int manaInvested)
{
PrintDebugNpc(PD_MAGIC,"Spell_ProcessMana called");
PrintDebugInt(PD_MAGIC,"### MAGIC ###-> invested Mana: ",manaInvested);
PrintDebugInt(PD_MAGIC,"### MAGIC ###-> Spell-Level: ",Npc_GetActiveSpellLevel(self));
if(Npc_GetActiveSpell(self) == SPL_LIGHT)
{
return Spell_Logic_Light(manaInvested);
};
if(Npc_GetActiveSpell(self) == SPL_FIREBOLT)
{
return Spell_Logic_Firebolt(manaInvested);
};

[ … … …]

if(Npc_GetActiveSpell(self) == SPL_SHRINK)
{
return Spell_Logic_Shrink(manaInvested);
};
};

Maybe I should add the “return 0” command above the last line.




G1 AI\ZS_Human\ZS_AssessQuietSound.d(27)
Error: Function should return value

func int ZS_AssessQuietSound()
{
PrintDebugNpc(PD_ZS_FRAME,"ZS_AssessQuietSound");
C_ZSInit();
if(self.guild == GIL_MEATBUG)
{
AI_ContinueRoutine(self);
return 0;
};
Npc_PercEnable(self,PERC_ASSESSDAMAGE,ZS_ReactToDamage);

[ … … …]

Npc_PercEnable(self,PERC_ASSESSUSEMOB,B_AssessUseMob);
AI_TurnToNPC(self,other);
};

Maybe I should add the “return 1” command above the last line.

However I imagine it’s preferable the replacement of the “int”function by the “void” one and the erasure of the “return 0” command.




G2 Story\Dialoge\DIA_PC_Thief_OW.d(530)
Error: Function should return value

func int DIA_Addon_ThiefOW_TooFar_Condition()
{
if(self.aivar[AIV_PARTYMEMBER] == TRUE)
{
if(C_DiegoTooFar(0))
{
if(Diego_TooFarComment == FALSE)
{
return TRUE;
};
}
else
{
Diego_TooFarComment = FALSE;
};
};
};

Maybe I should replace the last command by the “return FALSE” command.

Kheiron
17.02.2008, 11:55
I'm very :(

Why is there no answer? §kratz

Is my English too bad? I'm sorry for that, but this is an international forum; it's necessary a bit of tolerance.

Does the work appear too hard? Really 6 confirmations/corrections will be enough; it will take only few minutes.

Do the questions appear too difficult? I presume they are very easy; a bit of knowledge of programming will be enough.

What's the problem? Tell me something. §cry

Bastardo
17.02.2008, 12:09
Don't be sad:).
As soon as someone capable will see your posts, you'll get your answers.

Maybe if a mod would move this to the help section...

WernerTWC
17.02.2008, 20:44
Why is there no answer? §kratz
Dunno why, i didn't reconized your postings, the last i saw untill now was
the one from 01.02.2008 01:54. :dnuhr:

Ok, ... when you start the game with the reparsed (and to you and the GS seems to be wrong scripts), does it start? Can you play it?
Does the mod-starter give errors?

Again: Forget about the GS, use it to extract the scripts (what you already have done), then close it and don't think at it again.
... I did it this way, and so i got the engish cleaned up scripts, and with these scripts i've made my own mod and published it, nobody complains that it doesn't work.

Just as an example the first thing on your list:


G2 Story\Dialoge\Dia_Sld_810_Dar.d(245)
Error: Comparison is possible only in ‘if’ expression

Quote:
func int DIA_Dar_Kameradenschwein_Condition()
{
if(Dar_LostAgainstCipher == TRUE)
{
self.aivar[AIV_LastFightComment] == FALSE; //geht NUR bei ECHTER Important-Info!
return TRUE;
};
};
Maybe I should replace the previous paragraph by the next one:

Quote:
func int DIA_Dar_Kameradenschwein_Condition()
{
if((Dar_LostAgainstCipher == TRUE) && (self.aivar[AIV_LastFightComment] == FALSE))
{
return TRUE;
};
};
Unfortunately I can imagine no solution about the cryptic German line.

Have you repasred it with your suggestion? ... should lead to an error, here is the line from the original script:

FUNC INT DIA_Dar_Kameradenschwein_Condition()
{
if (Dar_LostAgainstCipher == TRUE)
{
self.aivar[AIV_LastFightComment] == FALSE; //geht NUR bei ECHTER Important-Info!
return TRUE;
};
};

The german comment btw is just "works only with REAL Important info".

BTW.: Your english more than good enough. :)

Kheiron
20.02.2008, 23:26
Dunno why, i didn't reconized your postings

I know the reason: that day many messages arrived in few hours and so mine went down quickly. Anyway there’s no problem; I don’t expect your answers every time. I don’t want to take advantage of moderators, administrators, governors or emperors ;); some hint by the common users will be enough. Many users had a look at my thread, but maybe no programmer :(.





Ok, ... when you start the game with the reparsed …. does it start? Can you play it?
Does the mod-starter give errors?

I already answered about these questions.


Finally I corrected some scripts and I compiled all them by the WernerTWC’s modified “.src” file; zSpy reported no critical error and the process was successful. Actually I’m able to compile the scripts with the usual “.src” files by the Gothic Starter Mod.

To tell the truth, few simple corrections were necessary. For example, when I added your “.src” modified file, the mod-starter expected 3 scripts which aren’t in the italian version nor in the english one; they are the next ones:
Story/B_AssignAmbientInfos/B_DMT_RitualDementor
Story/B_AssignAmbientInfos/B_ORC_AntiPaladinX
Story/B_AssignAmbientInfos/B_PAL_SchiffswacheAmbient.

Anyway, now I can compile all scripts with or without your “.src” modified file, because the mod-starter gives only green common warnings, instead of red critical errors. Both modified Gothic I and Gothic II start and I can play them :D


Have you repasred it with your suggestion?

Yes. The mod-starter and Gothic Sourcer give no critical error again.

In short, the mod-starter works if the original scripts or my solutions are included; Gothic Sourcer works only if my solutions are included.





here is the line from the original script.

I already know the original german script, but it’s incorrect. The double “=” is possible only in ‘if’ expression, like the next one


if(Dar_LostAgainstCipher == TRUE)

but not out ‘if’ expression, like the next one


self.aivar[AIV_LastFightComment] == FALSE;

Well … there’s an error: it isn’t a problem for the mod-starter, but it’s a problem for Gothic Sourcer. There’re 2 possibilities:
a) I could remove the useless “=” (because this is the right solution of some similar errors, which are described in my report);
b) I could move the incorrect line into the “if” expression (in order to produce a paragraph which is similar to the other ones into the same script).


The german comment btw is just "works only with REAL Important info".

Google gave me a similar translation, but I didn’t understand its sense; now I can understand its sense but not its function. Anyway I realize it was important for the german programmers, not for me now.





Forget about the GS, use it to extract the scripts (what you already have done), then close it and don't think at it again.

There are 3 reasons which induce me to persist in my aims.

The first reason.
Gothic Sourcer requires only the decompiled scripts from the appropriate script pack. On the contrary, the mod-starter requires all scripts, animations, models, textures, sounds; besides, they require the german modkit and finally the german modkit requires the english fixed starter §burn
Unfortunately, there isn’t an italian modkit nor a italian fixed starter; they aren’t indispensable, because I can use profitably the german modkit and the english fixed starter, but the complete procedure is long and complicated.
Most of all, I’m doubtful about the automatic operations by the Gothic II german modkit §kratz: it’s very big and I don’t know how it works, what it modifies and which files are replaced.


I did it this way, and so i got the engish cleaned up scripts, and with these scripts i've made my own mod and published it, nobody complains that it doesn't work.

The problem is different. Your total conversion didn’t need any localized file and it might put up with eventual bugs (although I played your mod, Kuhajag, and I found no bug … by the way, nice mod, thank you). On the contrary, I wish to modify the original Gothic I and II, in order to play them again, and I don’t want to take new problems during the adventure in Khorinis.

The second reason.
Many italian fans would like to modify Gothic I and II, but it always appears impossible and so they refrain. Few months ago I wrote an useful and appreciated tutorial (http://www.multiplayer.it/forum/gothic-italia/233490-tutto-mods-info-progetti-passati-futuri-dedicati-saga-gothic-34.html) at Multiplayer.it about the Player Kit, the english fixed starter, GoMan and VDFTool; finally, also the italian fans can install german mods and replace animations, models, textures. Now I wish to explain the procedure to modify and replace scripts.
Of course, if I propose the long and complicated procedure by the german modkit and the german mod-starter, I will be scourged, skinned, crucified, impaled, burnt and, most of all, banned (the italian moderator is always angry and pitiless :p).

The last, but not the least, reason: I’m very stubborn §wink



In conclusion, the mod-starter works if the original scripts or my solutions are included, but the relative procedure isn’t easy. Gothic Sourcer works only if my solutions are included, but I may not rely on them, because I’m not able to program and maybe the softwares don’t notice my probable errors.

:dnuhr:

Kheiron
27.10.2008, 22:49
Hi.

I'm again in this old thread because I've the final solutions for all Gothic 1&2 errors now :D

Here they're.
Gothic Incorrect Scripts.rar (http://upload.worldofplayers.de/files/Gothic Incorrect Scripts.rar)

That's all.

Korianous
28.10.2008, 20:57
Hey,

Nice solutions. I encountered many of the problems you did, solved some of them similarly, other ones in a different way. The coolest thing about scripting is when you find clever solutions to a problem. :D

Nice work though, mate. Props to ya.