1
00:00:00,000 --> 00:00:18,000
Welcome to the tutorial, i�m Blackeye, and i�ll show you how to create a NPC, how to put him in the world, how to create a dialog for him, how to create the needed startup and ini and to test it in the end.

2
00:00:18,000 --> 00:00:43,000
Needed things are: a text-editor, i use ultra-edit, the windows-editor would work also but it�s not so comfortable, you need the spacer, the mesh from �Rabe� from the Modder-Database of World of Gothic, the spacer-tutorial could also be helpful.

3
00:00:43,000 --> 00:01:18,000
I download here the mesh from �Rabe� and save it Then you need patience of course.

4
00:01:18,000 --> 00:01:43,000
We save now our mesh in the meshes/level folder, it must be there. It�s the burgcamp. 3ds. We should remember this name, we need it later.

5
00:01:43,000 --> 00:02:01,000
Now we go to the system-folder and start the gothic-starter, the ini you choose here doesn't matter, you just have to choose ''something'' in order to bring up the spacer.

6
00:02:01,000 --> 00:02:17,000
Now we do the points mesh loading, convert it to a ZEN, save it, createing waypoints and freepoints, adding the bread we need for our little quest/dialog later on.

7
00:02:17,000 --> 00:02:54,000
The spacer is loaded now, let�s start, we open now a mesh, that�s why we should choose �open mesh�, we open now our burgcamp. 3ds-mesh, now the world is loaded but not compiled, that�s why we choose �world� - �compile world�

8
00:02:54,000 --> 00:03:06,000
We choose outdoor, indoor is only for caves and dungeons and such, we also disable the �editor-mode� because we don�t wanna make changes to the mesh

9
00:03:06,000 --> 00:03:13,000
Now we compile, this takes a while, done.

10
00:03:13,000 --> 00:03:24,000
When you take a look around, you see it�s kinda dark, so we choose �world� - �compile light� - lightmaps high -compile

11
00:03:24,000 --> 00:03:43,000
The ZEN is now nearly ready, here will later on the NPC standing.

12
00:03:43,000 --> 00:04:16,000
Saving in the folder data/world as burgcamp.zen

13
00:04:16,000 --> 00:04:38,000
Now we create a waypoint for our NPC, he�ll need it to be apear somewhere, we call the waypoint here �BURGCAMP01�, now moving it a bit [press once �m�, then the arrow-keys to move it, �m� once again to stop the moving].

14
00:04:38,000 --> 00:05:19,000
Next, a freepoint. The NPC will do a daily-routine there. We name it �FP_STAND_BURGCAMP01� [typos in the video], the arrows shows the direction of the NPC, in which direction he looks.

15
00:05:19,000 --> 00:05:33,000
The �STAND� must be in the name of the freepoint, because in some scripts of daily-routines it�s defined that the NPC is searching for a freepoint with the name �stand� in it. Now our ZEN is nearly ready.

16
00:05:33,000 --> 00:05:52,000
For the quest later on we need to insert a bread which we must bring then to the NPC, let�s see where we place it, here on the wall is a good place for it. *movespeed adjusting*

17
00:05:52,000 --> 00:06:37,000
We choose �abstract vob� - oCItemsScripted - rightclick in the world - insert oCItem - �item food bread� (ItFo_Bread), we position it on the wall

18
00:06:37,000 --> 00:07:06,000
Now we save the ZEN again but we leave the spacer open, we need it later on, first part solved.

19
00:07:06,000 --> 00:07:58,000
Now we open the �externals�, *opening the externals*, in it there are the most of the functions given by the engine, 

20
00:07:58,000 --> 00:08:15,000
That you�ll need for dialogs, creating NPCs, for varied daily-routins and for the AI of the NPC.

21
00:08:15,000 --> 00:08:33,000
Now we create the NPC with his daily routines [TA�s ... in german it�s �Tages Abl�ufe� which means �daily routines�],... well we don�t create it on our own, we just copy and adjust an existing one.

22
00:08:33,000 --> 00:08:49,000
going to the folder * (content/story/npc) i choose �pepe� now.

23
00:08:49,000 --> 00:09:05,000
We copy all of that npc, make a new file in the editor, paste all of �pepe� in there, close the �old� pepe, that script will not be changed,

24
00:09:05,000 --> 00:09:48,000
Now we exchange the name �pepe� in the whole script with �franz� [replace all in the editor]

25
00:09:48,000 --> 00:10:32,000
He has the ID 912, you should always change the ID because 2 NPCs with the same ID-number are �forbidden�. We choose now 66666, we exchange 912 with 66666, we do this in the instance, in the ID and in the TA [daily-routine].

26
00:10:32,000 --> 00:11:01,000
In the TA it is important that you have RTN in the beginning of the name and in the end the ID (66666), in the middle there is the �name� of the TA, normaly �start� is the first TA of every NPC.

27
00:11:01,000 --> 00:11:17,000
Now the �flags� -> NPC_FLAG_IMMORTAL or 0 [not immortal]

28
00:11:17,000 --> 00:11:34,000
Here you could choose a guild.

29
00:11:34,000 --> 00:12:09,000
Here you can choose a kind of �level-scaling�, here the farmer can fight (maybe succsesful) against you when you are a chapter 1 char, when you are in chapter 5 he wouldn�t be a problem for you anymore.

30
00:12:09,000 --> 00:12:33,000
Tactics says how the NPC is fighting,... weapon choosing,... �self� means always the NPC you are creating, ...

31
00:12:33,000 --> 00:12:48,000
With �B_CreateAmbientInv� you create a standard inventory, so that the NPC has just something in his inventory if you beat him up and plunder  him.

32
00:12:48,000 --> 00:13:00,000
Down here you can set the appearance, you can change this later, you can copy that from existing NPCs.

33
00:13:00,000 --> 00:13:09,000
Here you can set the thickness of the NPC, if you would choose i.e. 3 then he�s kinda fat.

34
00:13:09,000 --> 00:13:26,000
Here you can choose �how� he�s �acting� (Tired / Militia / Mage / Arrogance / Relaxed), how he�s moving.

35
00:13:26,000 --> 00:13:54,000
Here you can give talents, i don�t talk about this right now, also here you can just later look in the scripts of other NPCs to learn what you can choose here.

36
00:13:54,000 --> 00:14:25,000
In the daily routine here, always the first daily routine [daily routine = Tages Ablauf (TA)] you use is written first, here it�s Rtn_Start_66666, you can later on also add other TA�s and name them different of course.

37
00:14:25,000 --> 00:14:56,000
Here is the TA set to �TA_Stand_Eating�, that means the NPC stands somewhere and eat something, from 8h till 22h, for humans you must have at least two TA�s in order to make it work, it�s very important that all TA�s added together fill up the 24 hours,.... monsters have only one TA.

38
00:14:56,000 --> 00:15:28,000
Here is the waypoint [WP] for the TA, for us it�s BURGCAMP01, we just copy it from the spacer and paste it in the script.

39
00:15:28,000 --> 00:16:11,000
Now we search for an other TA (just to have some alternation), we choose one in which the Free Point [FP] will be needed, we choose �Stand_Guarding�, so he will stand in a special guarding animation, look around and such.

40
00:16:11,000 --> 00:16:25,000
We will use the same WP, but he will automatically use the FP we created, the TA �Stand_Guarding� is looking for the next reachable FP and will use it, but for that the FP must have the �STAND� in it�s name, otherwise the TA_Stand_Guarding coudn�t find it.

41
00:16:25,000 --> 00:16:40,000
There he will stand, looking in the direction of the arrow, towards the gate.

42
00:16:40,000 --> 00:16:50,000
Well, that�s it, the NPC is ready, we just need to save him, for that we copy the name of him from here,...

43
00:16:50,000 --> 00:17:21,000
We save it in �Gothic II\_work\data\Scripts\Content\Story\NPC\� as �BAU_66666_Franz.d�, the *.d ending is for all gothic-script-files, they just named it like this.

44
00:17:21,000 --> 00:17:42,000
After we saved it, the entries are colored/marked here in Ultra Edit because of it�s �word-list� [downloadable on WoG, also for the freeware editor �crimson edit�],... it just helps to keep the overview.

45
00:17:42,000 --> 00:17:53,000
Now we create the dialog, in which you just should bring the NPC a bread.

46
00:17:53,000 --> 00:18:11,000
Like always we just search for an existing script of a dialog, ... scripting is very often just copy and paste,... 

47
00:18:11,000 --> 00:18:35,000
We choose a farmer, i made this dialog with the Miranda Dialog Creator. [but you should learn to script a dialog manualy before you are start using such tools]. And instead using such a tool we just do it manually and copy and paste it.

48
00:18:35,000 --> 00:18:52,000
The first part is the exit-dialog, ... this part makes it possible  to choose �end� in a dialog.

49
00:18:52,000 --> 00:19:11,000
We just copy it, and also the next, the �hello� �dialog, because this is the first dialog you will have with a NPC. 

50
00:19:11,000 --> 00:19:24,000
So, copy it and paste it here in our new created text-file.

51
00:19:24,000 --> 00:19:41,000
Now our farmer isn�t called �Marim�  anymore, he also get�s a new ID-number, and he isn�t conntected to �Loa�, so we change the whole name, or better let�s say all what is written before the �_exit� in the name (instance).

52
00:19:41,000 --> 00:20:12,000
We just copy the name of the farmer and paste it there, or we use the exchange functions, should be known from any other text editor, just exchange every mention of the name.

53
00:20:30,000 --> 00:20:50,000
Here you can set conditions to when a dialog becomes visible, this is the exit dialog and it should be visible every time so it�s set to �true�, this means there are no conditions for the dialog and it will be visible everytime you talk to that NPC.

54
00:20:50,000 --> 00:21:25,000
�Important = false� means that the NPC will not talk to you automatically, an �end-dialog� set to �true� makes no sense, so here it�s false. The dialog is �permanent�, that means the dialog is avaiable not only once, but everytime you talk to that NPC.

55
00:21:25,000 --> 00:21:45,000
Here is the dialog-number, �999� means it�s at the end of the choosing-options in a dialog, that number sorts the dialog-options, but you can leave this away and gothic will sort it automatically.

56
00:21:45,000 --> 00:22:06,000
The �DIALOG_ENDE� is a string, you can put there text, it just must be in that quotation marks.

57
00:22:06,000 --> 00:22:42,000
Here is the condition. And here is the info-function (must also be named up here). Right now it�s just the end dialog, but you can put here all speak-outputs, animations, things like to hand over the bread and such.

58
00:22:42,000 --> 00:23:02,000
But now we are doing the hello dialog. We choose �important�, so the NPC will automatically talk to you. He wants the bread so that�s why he should talk to you. The dialog is not �permanent�, because he would always talk to you when you are near him, that we don�t want.

59
00:23:02,000 --> 00:23:16,000
We  don�t need the description because he talks automatically to us, so we comment out it with two slashs.

60
00:23:16,000 --> 00:23:28,000
Now we can set a condition, here is no condition because it�s the first dialog, so we leave it blank.

61
00:23:28,000 --> 00:23:52,000
Going to the info-function, important is here the AI_output, that sets what the NPCs will say.

62
00:23:52,000 --> 00:24:16,000
After the �slashs� are what�s later on will be used for the subtitles in the game. Here is the name of the matching soundfile, those names has to be unique of course.

63
00:24:16,000 --> 00:24:30,000
The filename indicates the name of the farmer, the dialog, the voice and a continuously number.

64
00:24:30,000 --> 00:24:46,000
We compare here the voice, it�s �3�, so we change it also here.

65
00:24:46,000 --> 00:25:18,000
�self� means always the NPC and �other� is our HERO. The one who is named first speaks, the other is the listener.

66
00:25:18,000 --> 00:26:05,000
Now we write the dialog, in this case �bring me the bread�.  The HERO asks �which bread, why should i bring it to you?�

67
00:26:05,000 --> 00:26:53,000
Now this is a copy&paste job, we change just the dialog-number, and write �the bread is on the city wall and i have a broken foot so i cannot reach it for myself�.

68
00:26:53,000 --> 00:28:04,000
The HERO answers �i bring you the bread�,  ... now we doing a log-entry,... i�m looking in another script because i haven�t all in mind, .... it�s always much copy&paste,.... 

69
00:28:04,000 --> 00:28:34,000
We just copy the needed lines and paste it here. Here is the name of the log-entry which will be displayed later on in the game.

70
00:28:34,000 --> 00:28:51,000
You could also do it as a string, but you can also name it directly. 

71
00:28:51,000 --> 00:29:38,000
Here is defined that�s it a mission for the quest-log, ... here that�s it a running quest, and here we can change the log-entry itself.

72
00:29:38,000 --> 00:30:18,000
Now we save the dialog, in story/dialoge  ... the file extentions is .d that is the ending for all gothic dialogs, also we name it DIA_  in the beginning so it can be easily identified as a dialog script.

73
00:30:32,000 --> 00:31:11,000
We create now the dialog when we bring the NPC the bread. We exchange �hello� with �bread� ... make some space for the better overview....

74
00:31:11,000 --> 00:31:30,000
�Important� is now false again, because we have to go to the NPC, also the out-commented description-line will be used again, we write there �I have found your bread�.

75
00:31:30,000 --> 00:31:40,000
Here i delete the unnecessary lines.

76
00:31:40,000 --> 00:31:56,000
Now we set the conditions to make this dialog avaible only if you have the bread and if you have done the dialog before.

77
00:31:56,000 --> 00:32:22,000
To find the matching command we look up the externals, and search for the �hasItems� function. We just copy the function, this just asks if the HERO has the bread.

78
00:32:22,000 --> 00:33:00,000
We paste it in our dialog, it�s a request so we need an �if�, the first part is who should have it, the hero in this case, the second variable is what he should have, in this case the bread.

79
00:33:00,000 --> 00:33:20,000
Here we say how much of the requested item is needed, bigger or equal one in this case.

80
00:33:20,000 --> 00:33:35,000
*adding some brackets*

81
00:33:55,000 --> 00:34:25,000
We search now for the �knowsInfo� because we want that the dialog comes up only if the other dialog already happend. The First �if� we set in brackets and add a double equal sign for the next request.

82
00:34:25,000 --> 00:34:59,000
We copy the dialogs name that should be known in order to activate the other dialog, and paste it here where it�s needed.

83
00:34:59,000 --> 00:36:06,000
Now this is the same procedure like last year, Miss Sophie, ... means dialog writing like before.

84
00:36:06,000 --> 00:36:40,000
Maybe you reconized that we didn�t gave him the bread till now, we look it up again, we need the function �b_giveInvItems�, first is named the one who gives something away, in this case the hero, second the receiver, the NPC (self).

85
00:36:40,000 --> 00:36:51,000
We exchange here gold with bread and the amount of 50 with 1.

86
00:36:51,000 --> 00:37:42,000
Here goes the log entry and it�s going to the solved quests.

87
00:37:42,000 --> 00:38:22,000
....saveing,... now we create the startup.ini, this is needed to register our NPC so we can see him later on in our little mod. Every NPC or monster which should be in the world must be spawned by the startup.ini.

88
00:38:22,000 --> 00:38:53,000
We create a new file, we open the originial gothic startup. We only copy that part from testlevel on.

89
00:38:53,000 --> 00:39:20,000
We paste it in the new file,... here it�s important to enter the *.zen name.� Means exchange �testlevel� with �burgcamp� or whatever your *zen is called.

90
00:39:20,000 --> 00:39:56,000
We save it as the startup_burgcamp.d, we look up the insert function for monsters and NPCs, copy and paste it in here. 

91
00:39:56,000 --> 00:40:20,000
Exchanging the giant rat with our NPC and exchanging the waypoint with our waypoint.

92
00:40:20,000 --> 00:40:56,000
Now our startup is ready, we just must enter it now in the file which shows the engine which files has to be �parsed�, that is the gothic.src. We enter here our startup.

93
00:40:56,000 --> 00:41:32,000
The �startup� is ready, now we have to create the �ini�, then only testing.

94
00:41:32,000 --> 00:41:53,000
We now go to the spacer and choose world - reparse scripts, there we choose the gothic.src.

95
00:41:53,000 --> 00:42:14,000
This takes a while,... you should get your hands to �cleaned uped� scripts, they�ll avaible at wog.

96
00:42:14,000 --> 00:42:50,000
Now we have to update and save the output units. Note: When you mod your own project, always "load" the OUs before you update and save them!

97
00:42:50,000 --> 00:43:48,000
Exiting the spacer, now we create the ini, for that we just go to the system-folder, we open the gothicgame.ini,... we don�t change much.

98
00:43:48,000 --> 00:44:00,000
IMPORTANT: We delete the �vdf�-file here.

99
00:44:00,000 --> 00:44:29,000
Here we enter our world, the world which should be loaded, �burgcamp.zen�, then we save it as the �burgcamp.ini�.

100
00:44:38,000 --> 00:44:53,000
Now we close and start up the gothic-starter,... here we go!

101
00:44:53,000 --> 00:45:04,000
*testing the quest*