Forum o Gothic i Moddingu
W tym toturialu napiszę jak stworzyć *NPC. W tym celu będzie nam potrzebny GMDK. Można go ściągnąć z stąd (G1) http://www.worldofgothic.de/dl/index.ph … ease_id=28 dla (G2) tutaj http://www.worldofgothic.de/dl/index.ph … ease_id=94 Gdy zainstalujemy to wchodzimy do folderu ?:\Gothic2\_Work\data\Scripts\Content\Story\NPC i znajdujemy jakiś NPC (np: BAU_900_Onar) i edytujemy go notatnikiem i będziemy mieli coś takiego:
instance BAU_900_Onar <-- *instancje NPC (Npc_Default)
{
// ------ NSC ------
name = "Onar"; <-- Imię NPC
guild = GIL_BAU; <-- Gildia NPC
id = 900; <-- *ID NPC
voice = 14; <-- Głos NPC
flags = NPC_FLAG_IMMORTAL; <-- ten NPC jest nieśmiertelny //NPC_FLAG_IMMORTAL oder 0 <-- to jest nieważne
npctype = NPCTYPE_MAIN; <-- Nastawienie NPC do nas (obojętny)
// ------ Attribute ------ <-- *atrybuty NPC
B_SetAttributesToChapter (self, 4); //setzt Attribute und LEVEL entsprechend dem angegebenen Kapitel (1-6)
// ------ Kampf-Taktik ------ <--Taktyka NPC
fight_tactic = FAI_HUMAN_STRONG; // MASTER / STRONG / COWARD
// ------ Equippte Waffen ------ <--Broń NPC //Munition wird automatisch generiert, darf aber angegeben werden
EquipItem (self, ItMw_1h_Bau_Mace); <--laga
// ------ Inventory ------
B_CreateAmbientInv (self); <--reszta ekwipunku
// ------ visuals ------ wygląd //Muss NACH Attributen kommen, weil in B_SetNpcVisual die Breite abh. v. STR skaliert wird
B_SetNpcVisual (self, MALE, "Hum_Head_FatBald", Face_N_OldBald_Jeremiah, BodyTex_N, ITAR_Vlk_H <-- aktualna zbroja);
Mdl_SetModelFatness (self, 2);
Mdl_ApplyOverlayMds (self, "Humans_Arrogance.mds"); // Tired / Militia / Mage / Arrogance / Relaxed
// ------ NSC-relevante Talente vergeben ------
B_GiveNpcTalents (self);
// ------ Kampf-Talente ------ <--Talenty //Der enthaltene B_AddFightSkill setzt Talent-Ani abhängig von TrefferChance% - alle Kampftalente werden gleichhoch gesetzt
B_SetFightSkills (self, 70); //Grenzen für Talent-Level liegen bei 30 und 60i
// ------ TA anmelden ------
daily_routine = Rtn_Start_900;
};
FUNC VOID Rtn_Start_900 () <-- *rutyna
{
TA_Sit_Throne (09,00,21,00,"NW_BIGFARM_HOUSE_ONAR_SIT");
TA_Sleep (21,00,09,00,"NW_BIGFARM_HOUSE_UP1_04");
};
Teraz możemy pozmieniać różne rzeczy NPC lub zrobić całkiem nowy NPC. Na razie zmieńmy mu Imię (imię musi znajdować się w cudzysłowu) ,zbroje zamieńmy z ITAR_VLK_H na ITAR_BAU_L broń dajmy mu zamiast ItMw_1h_Bau_Mace (laga) miecz półtoręczny ItMw_Schwert5 możemy mu zmienić gildie z BAU na NONE (w G1 NON) (brak gildi) oraz zmienimy mu rutynę. Musimy mu zmienić na nieużywane instancje i ID (zaznaczyłem na żółto[ ten numer musi być zawsze taki sam w tych 4 miejscach]). Nie zapomnijcie dać innej instancji (wystarczy numer zmienić). Nasz skrypt powinien wyglądać tak:
instance NONE_19900_Glupol (Npc_Default) <-- tutaj zmieniłem instancje
{
// ------ NSC ------
name = "Głupol";
guild = GIL_NONE;
id = 19900;
voice = 14;
flags = 0; <-- tutaj dałem flags 0 żeby nasz NPC był śmiertelny
npctype = NPCTYPE_MAIN;
// ------ Attribute ------
B_SetAttributesToChapter (self, 4); //setzt Attribute und LEVEL entsprechend dem angegebenen Kapitel (1-6)
// ------ Kampf-Taktik ------
fight_tactic = FAI_HUMAN_STRONG; // MASTER / STRONG / COWARD
// ------ Equippte Waffen ------ //Munition wird automatisch generiert, darf aber angegeben werden
EquipItem (self, ItMw_Schwer5);
// ------ Inventory ------
B_CreateAmbientInv (self);
// ------ visuals ------ //Muss NACH Attributen kommen, weil in B_SetNpcVisual die Breite abh. v. STR skaliert wird
B_SetNpcVisual (self, MALE, "Hum_Head_FatBald", Face_N_OldBald_Jeremiah, BodyTex_N, ITAR_BAU_L);
Mdl_SetModelFatness (self, 2);
Mdl_ApplyOverlayMds (self, "Humans_Arrogance.mds"); // Tired / Militia / Mage / Arrogance / Relaxed
// ------ NSC-relevante Talente vergeben ------
B_GiveNpcTalents (self);
// ------ Kampf-Talente ------ //Der enthaltene B_AddFightSkill setzt Talent-Ani abhängig von TrefferChance% - alle Kampftalente werden gleichhoch gesetzt
B_SetFightSkills (self, 70); //Grenzen für Talent-Level liegen bei 30 und 60i
// ------ TA anmelden ------
daily_routine = Rtn_Start_19900;
};
FUNC VOID Rtn_Start_19900 ()
{
TA_Sit_Throne (09,00,21,00,"NW_BIGFARM_HOUSE_ONAR_SIT");
TA_Sleep (21,00,09,00,"NW_BIGFARM_HOUSE_UP1_04");
};
Teraz wystarczy zapisać skrypt w _Work\data\Scripts\Content\Story\NPC Uwaga jak zapisujemy to rozszerzenie pliku musi być .d I teraz wystarczy zrobić nową paczkę z modem (to nie w tym tutku) i dodać naszego NPC do startup.d (_Work\data\Scripts\Content\Story) Musimy gdzieś w środku dodać taką linijkę:
Wld_InsertNpc (BAU_19900_Glupol, "NW_BIGFARM_HOUSE_UP1_04");
-----------------------------------------------------------------------------------------------------------
*NPC to postacie sterowane przez komputer
*Instancje kod za pomocą którego możemy dodać do gry naszego NPC
*ID numer NPC
*nieśmiertelny lub śmiertelny
nieśmiertelny:
flags = NPC_FLAG_IMMORTAL;
śmiertelny:
flags = 0;
*atrybuty (siła, mana, zręczność życie)
*rutyna czynności postaci (dokładnie opisze to w innym toturialu)
Ostatnio edytowany przez Jabko (2009-04-03 18:29:05)
Offline