Zaklęcie wskrzeszenia 11659 24

O temacie

Autor Czarny133

Zaczęty 22.07.2013 roku

Wyświetleń 11659

Odpowiedzi 24

inż. Avallach

inż. Avallach

Administrator
posty7661
Propsy5239
NagrodyV
ProfesjaProgramista
  • Administrator
W pliku Classes.d znalazłem to:

// Aktueller Npc und der SC
INSTANCE self,other (C_NPC);

// Opfer bei "witness"-Aktionen
INSTANCE victim(C_NPC);

// aktuelles Item
INSTANCE item(C_Item);

// Und der Player immer als globale Instanz
INSTANCE hero(C_NPC);

Chciałbym się dowiedzieć za co konkretnie odpowiada victim.
To zmienne których wartość jest dynamicznie przypisywana przez silnik gry. Victim jest związana z systemem "newsów" w grze (npc przekazują sobie informacje o wydarzeniach takich jak bójki). Victim to ofiara bójki z analizowanego "newsa". W wielu przypadkach jednak wygodniej korzystać ze zmiennej other, ale nie będę tu wnikał jak i kiedy one działają, bo nie o to było pytanie.

A po drugie to w pliku Constants.d znalazłem to:

const int TARGET_TYPE_ALL = 1;
const int TARGET_TYPE_ITEMS = 2;
const int TARGET_TYPE_NPCS = 4;
const int TARGET_TYPE_ORCS = 8;
const int TARGET_TYPE_HUMANS = 16;
const int TARGET_TYPE_UNDEAD = 32;

Nie dałoby się tu wpisać nowej wartości i jakoś jej zdefiniować? Skoro można ustawić czarowi działanie na itemach to czy nie dałoby się dorobić działania na trupach?
Możesz sobie dopisywać nowe wartości, ale nie zmienia to faktu że algorytmy w silniku które ten parametr potem odczytują nie będą miały zaprogramowanego sposobu postępowania dla nich. Musiałbyś zmodyfikować kod silnika gry, a to wymaga znajomości tematu takiego jak reverse engineering (i jeśli nie chciał byś wychodzić poza skrypty, także pakietów skryptów "Ikarus" i "LeGo").

kaczka

kaczka

RaveN Studio
Definitely not kaczka!
posty2280
Propsy2392
NagrodyV
ProfesjaLvl designer
  • RaveN Studio
  • Definitely not kaczka!
Hmm... a nie dałoby rady pokombinować z Wld_RemoveNpc i Wld_InsertNpc?
 

mass1500

mass1500

Użytkownicy
posty149
Propsy11
ProfesjaGracz
  • Użytkownicy
nie sprawdzałem tego ale mógłbyś po prostu usunąć npc funkcją Wld_RemoveNpc, a potem przywołać funkcją Wld_InsertNpc dodałbyś jeszcze jakieś efekty wizualne żeby to nie wyglądało jakoś tak sztwyno :D
 


Lehona

Lehona

Użytkownicy
posty196
Propsy190
  • Użytkownicy
Just to give some perspective on what doesn't seem to work:

At first I tried to change oCSpell:IsTargetTypeValid() because it tests for oCNpc::IsDead(), but it didn't do anything and I noticed that if targetType = Target_Type_All; than it always returns true anyway. I took a quick glance over oCSpell:IsValidTarget() but that doesn't seem to check whether the NPC is dead either so I didn't try anything.
Then I tried just setting a dead NPC as focus by brute force, ie her.focus_vob = dead_npc; but that just makes the NPC disappear after a couple of seconds??? I wasn't able to hit him with a spell either, but I might have if I tried harder, I'm not quite sure.
I have deleted the condition oCNpc::IsDead() from oCAIHuman::CheckFocusVob() (because that is used in oCNpc::CollectFocusVob()) but to no avail :(

For now I can't find the code that is responsible for excluding dead NPCs from the focus. I believe it might be indirectly "hidden" by using oCNpc_States::IsInState(), but there is no documentation for state-code <-> states and because this isn't really my problem I just can't really be bothered to test all that stuff, partly because I don't have my usual coding environment available to me.

Conclusion: Everything is possible, but this seems to be god damn hard to do. I can't be bothered.
 
Unless specified otherwise, my posts are always about Gothic 2 Night of the Raven.


0 użytkowników i 1 Gość przegląda ten wątek.
0 użytkowników
Do góry