Wyświetlanie otrzymanych obrażeń 12332 33

O temacie

Autor Silver

Zaczęty 13.05.2012 roku

Wyświetleń 12332

Odpowiedzi 33

Lehona

Lehona

Użytkownicy
posty196
Propsy190
  • Użytkownicy
You might want to use this handy little script: http://forum.worldofplayers.de/forum/threads/1149697-Script-Eigene-Schadensberechnung :)

If you initialise the script with InitDamage() in the Init_Global(), you can display the damage with Print(IntToString(dmg)); in the DMG_OnDmg()-function.

You don't have to keep track of anything :>

If you've got any more questions, feel free to ask. You need an up to date version of the HookEngine.d (from LeGo), though, it can be downloaded here: https://www.assembla.com/code/lego2/subversion/nodes/HookEngine.d
As long as you've got Ikarus, the HookEngine.d can run without any further LeGo scripts.
 
Unless specified otherwise, my posts are always about Gothic 2 Night of the Raven.

Bogdan Zwei

Bogdan Zwei

Użytkownicy
Wulgarny skurwiel pierdolony.
posty1864
Propsy541
Profesjabrak
  • Użytkownicy
  • Wulgarny skurwiel pierdolony.
So you mean if he put the script to the StartUp.d and he do a script with Print(IntToString(dmg)); to B_AssessDamage.d and he hit an enemy, the damage dealt will print on the screen, right?
 
:ok: zachęca do dalszej pomocy. Nie zapominaj o tym!

Prywatne wiadomości typu "Ej, pomocy" kasuję od razu. Od tego jest forum, a nie PW.

To me, defeat in anything is merely temporary, and its punishment is but an urge for me to greater effort to achieve my goal. Defeat simply tells me that something is wrong in my doing; it is a path leading to success and truth.

In order to realize our true self we must be willing to live without being dependent upon the opinion of others.

Lehona

Lehona

Użytkownicy
posty196
Propsy190
  • Użytkownicy
No, the function DMG_OnDmg() will be called when damage is dealt, put your prints into that function.
 
Unless specified otherwise, my posts are always about Gothic 2 Night of the Raven.

Bogdan Zwei

Bogdan Zwei

Użytkownicy
Wulgarny skurwiel pierdolony.
posty1864
Propsy541
Profesjabrak
  • Użytkownicy
  • Wulgarny skurwiel pierdolony.
func int DMG_OnDmg(var int victimPtr, var int attackerPtr, var int dmg) {
// Diese Funktion anpassen, wenn ihr den Schaden verändern wollt! 'dmg' ist der von Gothic berechnete Schaden.
return dmg;
};


func void _DMG_OnDmg() {
EDI = DMG_OnDmg(EBP, MEM_ReadInt(MEM_ReadInt(ESP+644)+8), EDI);
};
func void InitDamage() {
const int dmg = 0;
if (dmg) { return; };
HookEngineF(6736583/*0x66CAC7*/, 5, _DMG_OnDmg);
dmg = 1;
};

So then In place where is "// Diese Funktion anpassen, wenn ihr den Schaden verändern wollt! 'dmg' ist der von Gothic berechnete Schaden." should I write Print(IntToString(dmg));, yes?
 
:ok: zachęca do dalszej pomocy. Nie zapominaj o tym!

Prywatne wiadomości typu "Ej, pomocy" kasuję od razu. Od tego jest forum, a nie PW.

To me, defeat in anything is merely temporary, and its punishment is but an urge for me to greater effort to achieve my goal. Defeat simply tells me that something is wrong in my doing; it is a path leading to success and truth.

In order to realize our true self we must be willing to live without being dependent upon the opinion of others.

Lehona

Lehona

Użytkownicy
posty196
Propsy190
  • Użytkownicy
Exactly. If you change the variable dmg you can change the damage dealt as well.
 
Unless specified otherwise, my posts are always about Gothic 2 Night of the Raven.

Bogdan Zwei

Bogdan Zwei

Użytkownicy
Wulgarny skurwiel pierdolony.
posty1864
Propsy541
Profesjabrak
  • Użytkownicy
  • Wulgarny skurwiel pierdolony.
Wow, heh, fast and nice trick. :)

I think I will try it... I don't like to have damage dealt in Gothic, it isn't Gothic climate, but anyways, why shouldn't I try it... :)
 
:ok: zachęca do dalszej pomocy. Nie zapominaj o tym!

Prywatne wiadomości typu "Ej, pomocy" kasuję od razu. Od tego jest forum, a nie PW.

To me, defeat in anything is merely temporary, and its punishment is but an urge for me to greater effort to achieve my goal. Defeat simply tells me that something is wrong in my doing; it is a path leading to success and truth.

In order to realize our true self we must be willing to live without being dependent upon the opinion of others.

chicken

chicken

RaveN Studio
posty1230
Propsy559
ProfesjaNierób
  • RaveN Studio
Ja odświeżę. Może się przydać, więc przeportowałem powyższą funkcję do G1:
func int DMG_OnDmg(var int victimPtr, var int attackerPtr, var int dmg) {
    // Diese Funktion anpassen, wenn ihr den Schaden verändern wollt! 'dmg' ist der von Gothic berechnete Schaden.
    return dmg;
};
    
    
func void _DMG_OnDmg() {
    EAX = DMG_OnDmg(ECX, MEM_ReadInt(MEM_ReadInt(ESP+548)+4), EAX);
};
func void InitDamage() {
    const int dmg = 0;
    if (dmg) { return; };
    HookEngineF(7567329, 6, _DMG_OnDmg);
    dmg = 1;
};

pawbuj

pawbuj

Użytkownicy
posty1625
Propsy135
ProfesjaSkrypter
  • Użytkownicy
jak wyświetlać obrażenia z tej kalkulacji, bo tutaj nie ma nigdzie printa
 

carelion

carelion

RaveN Studio
Moete Kita Zo!
posty153
Propsy73
Profesjabrak
  • RaveN Studio
  • Moete Kita Zo!
Wyświetl wartość dmg w funkcji DMG_OnDmg.
 

pawbuj

pawbuj

Użytkownicy
posty1625
Propsy135
ProfesjaSkrypter
  • Użytkownicy
Ja odświeżę. Może się przydać, więc przeportowałem powyższą funkcję do G1:
func int DMG_OnDmg(var int victimPtr, var int attackerPtr, var int dmg) {
    // Diese Funktion anpassen, wenn ihr den Schaden verändern wollt! 'dmg' ist der von Gothic berechnete Schaden.
    return dmg;
};
   


   
func void _DMG_OnDmg() {
    EAX = DMG_OnDmg(ECX, MEM_ReadInt(MEM_ReadInt(ESP+548)+4), EAX);
};
func void InitDamage() {
    const int dmg = 0;
    if (dmg) { return; };
    HookEngineF(7567329, 6, _DMG_OnDmg);
    dmg = 1;
};
wywala mi unknown identifier przy hookengineF
 

Splash

Splash

Moderator
posty4209
Propsy3412
ProfesjaNierób
  • Moderator
Parsujesz funkcję po LeGo?
 
Nie zajmuję się multiplayerami do Gothica. Przestańcie zawracać mi tym głowę...
Ps. Siemekk ma downa i śpi w pufie

pawbuj

pawbuj

Użytkownicy
posty1625
Propsy135
ProfesjaSkrypter
  • Użytkownicy
Parsujesz funkcję po LeGo?

tak.

kiedyś próbowałem damage wyświetlać tą funkcją, ale niestety wykazuje błędy w liczeniu (nie zlicza pierwszego uderzenia!)

var int lastHeroHP;

func void ciosdlahero ()//wyśiwtle zadawane obrażenia
{
   if (hero.attribute[0] < lastHeroHP)
   {
      damg_hero = lastHeroHP - hero.attribute[0];
      print (IntToString(damg_hero));
      lastHeroHP = hero.attribute[0];
     
};
};
 

chicken

chicken

RaveN Studio
posty1230
Propsy559
ProfesjaNierób
  • RaveN Studio
W funkcji _DMG_OnDmg printuj rejestr EAX po prostu.

pawbuj

pawbuj

Użytkownicy
posty1625
Propsy135
ProfesjaSkrypter
  • Użytkownicy
W funkcji _DMG_OnDmg printuj rejestr EAX po prostu.
wywala mi unknown identifier przy hookengineF - ?

dałem radę swoim przykładem, poprawiłem go .

 


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