Problem z adresem 2961 10

O temacie

Autor Siemekk

Zaczęty 18.12.2016 roku

Wyświetleń 2961

Odpowiedzi 10

Siemekk

Siemekk

Złote Wrota
posty2143
Propsy1154
ProfesjaProgramista
  • Złote Wrota
Chcę napisać funkcję która powala przeciwnika do nieprzytomności. (DropUnconscious). Jednak nie wiem czemu funkcja mi crashuje :/
target_ptr = oCNpc_GetPointer(target);
ocnpc_attacker = oCNpc_GetPointer(hero);
CALL_IntParam (0); //float param
CALL_IntParam (ocnpc_attacker);//hero
CALL__thiscall (target_ptr, 7560880);//slf
Ktoś wie co może być grane :/ Wcześniej zdawało się działać, ale teraz już nie :/
 

P.S A Splash w szafie i nie ma psychy by mi dać bana.

Bogdan Zwei

Bogdan Zwei

Użytkownicy
Wulgarny skurwiel pierdolony.
posty1864
Propsy541
Profesjabrak
  • Użytkownicy
  • Wulgarny skurwiel pierdolony.
Jeśli dalej będziesz posyłał tylko bezsensowne fragmenty skryptów - nikt Ci nie będzie pomagał.
 
: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.

Siemekk

Siemekk

Złote Wrota
posty2143
Propsy1154
ProfesjaProgramista
  • Złote Wrota
func int oCNpc_GetPointer(var C_NPC slf)
{
if (!Hlp_IsValidNpc(slf))  {
    MEM_Error (ConcatStrings ("oCNpc_GetPointer: Invalid c_npc: ", IntToString (slf.id)));
    return 0;
    };
    MEM_ReinitParser();
    var c_npc hlp; var int ptr;
hlp = Hlp_GetNpc(MEM_HELPER_INST);
MEM_Helper = Hlp_GetNpc (hlp);
Npc_SetTarget(hlp,slf);//self,other
ptr = MEM_Helper.enemy;

return ptr;

};

func void Drop(var c_npc slf)
{
        var int target_ptr; var int ocnpc_attacker
target_ptr = oCNpc_GetPointer(slf);
ocnpc_attacker = oCNpc_GetPointer(hero);
        const int oCNpc_Drop = 7560880; // oCNpc::DropUnconscious(float oCNpc *) 0x00735EB0
CALL_IntParam (0); //float param
CALL_IntParam (ocnpc_attacker);//hero
CALL__thiscall (target_ptr, oCNpc_Drop);//slf 
};
 

P.S A Splash w szafie i nie ma psychy by mi dać bana.

Splash

Splash

Moderator
posty4209
Propsy3412
ProfesjaNierób
  • Moderator
Nie lepiej użyć MEM_InstToPtr?
 
Nie zajmuję się multiplayerami do Gothica. Przestańcie zawracać mi tym głowę...
Ps. Siemekk ma downa i śpi w pufie

Siemekk

Siemekk

Złote Wrota
posty2143
Propsy1154
ProfesjaProgramista
  • Złote Wrota
Też crashuje :/ Gdy wywalam funkcję to jest print, ale jak funkcja jest to crashuje :/
Kod z AV:
======================================= UNHANDLED EXCEPTION OCCURED ======================================================
======================================= CRASH INFOS: =====================================================================
Gothic II - 2.6 (fix), Parser Version: 50
User:  Siemekk,  CPUType: 586,  Mem: 0 MB total, 0 MB free
Camera: Pos(31771.8203/4650.42676/-18231.2109), At(-0.80174464/-0.325796068/-0.50106132)
Startup Options:-game:swiat.ini -zreparse -znomusic -znosound -zmaxframerate:60
=============================================== CALLSTACK : ==============================================================
0023:0079249D (0x00003FCD 0x00AB4108 0x00000000 0x00AB40C0) Gothic2.exe, zCParser::DoStack()+2877 byte(s), P:\dev\g2addon\release\ZenGin\_ulf\zParser.cpp, line 1405+40 byte(s)
0023:00792504 (0x00003FCD 0x00AB4108 0x00000000 0x00AB40C0) Gothic2.exe, zCParser::DoStack()+2980 byte(s), P:\dev\g2addon\release\ZenGin\_ulf\zParser.cpp, line 14150023:00792504 (0x0008FA77 0x00AB4108 0x00000000 0x00AB40C0) Gothic2.exe, zCParser::DoStack()+2980 byte(s), P:\dev\g2addon\release\ZenGin\_ulf\zParser.cpp, line 1415
AB40C0) Gothic2.exe, zCParser::DoStack()+2980 byte(s), P:\dev\g2addon\release\ZenGin\_ulf\zParser.cpp, line 1415
0023:00792504 (0x0008FA77 0x00AB4108 0x00000000 0x00AB40C0) Gothic2.exe, zCParser::DoStack()+2980 byte(s), P:\dev\g2addon\release\ZenGin\_ulf\zParser.cpp, line 1415
0023:00792504 (0x000047F4 0x00AB4108 0x00000000 0x00AB40C0) Gothic2.exe, zCParser::DoStack()+2980 byte(s), P:\dev\g2addon\release\ZenGin\_ulf\zParser.cpp, line 1415
0023:00792504 (0x00007B14 0x00AB4108 0x00000000 0x00AB40C0) Gothic2.exe, zCParser::DoStack()+2980 byte(s), P:\dev\g2addon\release\ZenGin\_ulf\zParser.cpp, line 14150023:00792504 (0x0000BAC8 0x18AD5114 0x00AB4118 0x00AB40C0) Gothic2.exe, zCParser::DoStack()+2980 byte(s), P:\dev\g2addon\release\ZenGin\_ulf\zParser.cpp, line 14150023:00792504 (0x0000BCC1 0x0082E6F0 0x00AB40C0 0xFFFFFFFF) Gothic2.exe, zCParser::DoStack()+2980 byte(s), P:\dev\g2addon\release\ZenGin\_ulf\zParser.cpp, line 14150023:00792CBF (0x00AB40C0 0x00004895 0x20C201A0 0x0043C804) Gothic2.exe, zCParser::CallFunc()+719 byte(s), P:\dev\g2addon\release\ZenGin\_ulf\zParser.cpp, line 15510023:00503270 (0x00400000 0x00000000 0x01524062 0x00000001) Gothic2.exe, HandledWinMain()+928 byte(s), P:\dev\g2addon\release\ZenGin\_carsten\zWin32.cpp, line 1169
0023:00792504 (0x0000BAC8 0x18AD5114 0x00AB4118 0x00AB40C0) Gothic2.exe, zCParser::DoStack()+2980 byte(s), P:\dev\g2addon\release\ZenGin\_ulf\zParser.cpp, line 14150023:00792504 (0x0000BCC1 0x0082E6F0 0x00AB40C0 0xFFFFFFFF) Gothic2.exe, zCParser::DoStack()+2980 byte(s), P:\dev\g2addon\release\ZenGin\_ulf\zParser.cpp, line 14150023:00792CBF (0x00AB40C0 0x00004895 0x20C201A0 0x0043C804) Gothic2.exe, zCParser::CallFunc()+719 byte(s), P:\dev\g2addon\release\ZenGin\_ulf\zParser.cpp, line 15510023:00503270 (0x00400000 0x00000000 0x01524062 0x00000001) Gothic2.exe, HandledWinMain()+928 byte(s), P:\dev\g2addon\release\ZenGin\_carsten\zWin32.cpp, line 1169
0023:00792504 (0x0000BCC1 0x0082E6F0 0x00AB40C0 0xFFFFFFFF) Gothic2.exe, zCParser::DoStack()+2980 byte(s), P:\dev\g2addon\release\ZenGin\_ulf\zParser.cpp, line 14150023:00792CBF (0x00AB40C0 0x00004895 0x20C201A0 0x0043C804) Gothic2.exe, zCParser::CallFunc()+719 byte(s), P:\dev\g2addon\release\ZenGin\_ulf\zParser.cpp, line 15510023:00503270 (0x00400000 0x00000000 0x01524062 0x00000001) Gothic2.exe, HandledWinMain()+928 byte(s), P:\dev\g2addon\release\ZenGin\_carsten\zWin32.cpp, line 1169
0023:00792CBF (0x00AB40C0 0x00004895 0x20C201A0 0x0043C804) Gothic2.exe, zCParser::CallFunc()+719 byte(s), P:\dev\g2addon\release\ZenGin\_ulf\zParser.cpp, line 15510023:00503270 (0x00400000 0x00000000 0x01524062 0x00000001) Gothic2.exe, HandledWinMain()+928 byte(s), P:\dev\g2addon\release\ZenGin\_carsten\zWin32.cpp, line 1169
0023:007929E7 (0x20C201A0 0x17E14280 0x20C20038 0x18C8F6C0) Gothic2.exe, zCParser::CallFunc()+23 byte(s), P:\dev\g2addon\release\ZenGin\_ulf\zParser.cpp, line 1488+23 byte(s)
0023:0043C804 (0x00000000 0x20C20038 0x00602CD7 0x17E14034) Gothic2.exe, oCTriggerScript::TriggerTarget()+836 byte(s), P:\dev\g2addon\release\Gothic\_bert\oTrigger.cpp, line 162
0023:0061077B (0x17E14034 0x00000000 0xC28F69A8 0xC26324BE) Gothic2.exe, zCTrigger::OnTimer()+43 byte(s), P:\dev\g2addon\release\ZenGin\_dieter\zVobMisc.cpp, line 473
0023:00602CD7 (0x00000001 0x075999C0 0x00000000 0x0135FCA8) Gothic2.exe, zCVob::DoFrameActivity()+119 byte(s), P:\dev\g2addon\release\ZenGin\_dieter\zVob.cpp, line 21790023:00502DFD (0x0135FED0 0x00000000 0x01524062 0x00000001) Gothic2.exe, WinMain()+141 byte(s), P:\dev\g2addon\release\ZenGin\_carsten\zWin32.cpp, line 1054+17 byte(s)
0023:006C87EB (0x00400000 0x01524062 0x0135FECC 0x7EFDE000) Gothic2.exe, oCGame::Render()+331 byte(s), P:\dev\g2addon\release\Gothic\_ulf\oGame.cpp, line 2658
0023:00425E6E (0x0082F0EC 0x00000000 0x000503DA 0x075999C0) Gothic2.exe, CGameManager::Run()+1598 byte(s), P:\dev\g2addon\release\Gothic\_bert\oGameManager.cpp, line 767+47 byte(s)
0023:0078188B (0x0000002C 0x000A9022 0x00000009 0x00000000) Gothic2.exe, MainProg()+75 byte(s), P:\dev\g2addon\release\Gothic\_ulf\Phoenix.cpp, line 111
0023:00503270 (0x00400000 0x00000000 0x01524062 0x00000001) Gothic2.exe, HandledWinMain()+928 byte(s), P:\dev\g2addon\release\ZenGin\_carsten\zWin32.cpp, line 1169
0023:00502DFD (0x0135FED0 0x00000000 0x01524062 0x00000001) Gothic2.exe, WinMain()+141 byte(s), P:\dev\g2addon\release\ZenGin\_carsten\zWin32.cpp, line 1054+17 byte(s)
0023:007D43F8 (0x00000004 0x0000FFFF 0x000000B8 0x00000000) Gothic2.exe, WinMainCRTStartup()+224 byte(s)

 

P.S A Splash w szafie i nie ma psychy by mi dać bana.

Lehona

Lehona

Użytkownicy
posty196
Propsy190
  • Użytkownicy
oCNpc_GetPointer()? What the fuck? That is exactly what _@() is for. No need to implement it weirdly yourself.
 
Unless specified otherwise, my posts are always about Gothic 2 Night of the Raven.

Siemekk

Siemekk

Złote Wrota
posty2143
Propsy1154
ProfesjaProgramista
  • Złote Wrota
Gdy użyłem funkcji w bindzie na FF wywaliło, zaś gdy użyłem tick_tock'a to działa. Więc chciałem użyć tego w kodzie którego fragment jest poniżej. Wywala coś z timerem, ale dlaczego skoro funkcja jest na triggerze...
if((target.guild < GIL_SEPERATOR_HUM) && (target.attribute[ATR_HITPOINTS]-dmg_sum <= 0) && (!Npc_IsInState(target,ZS_Unconscious)) && (target.aivar[AIV_DROPDEADANDKILL] == FALSE))
{
CALL_IntParam (0);
CALL_IntParam (_@(hero));
CALL__thiscall (_@(target), 7560880);
}
Cały licznik:
Klik
 

P.S A Splash w szafie i nie ma psychy by mi dać bana.

Bogdan Zwei

Bogdan Zwei

Użytkownicy
Wulgarny skurwiel pierdolony.
posty1864
Propsy541
Profesjabrak
  • Użytkownicy
  • Wulgarny skurwiel pierdolony.
Sorki za offtop ale patrząc na ten skrypt który podałeś z Githuba widzę skrypty CZ.  :lol2:

Może zamiast _@(hero) spróbuj var int _hero; _hero = _@(hero);?
 
: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
You're pushing 2 parameters to a call when it only needs one. Don't corrupt the stack...

Edit: @Bogdan: What difference is that supposed to make? (Hint: It makes none. Don't just throw shit at a wall and see if it sticks...)
 
Unless specified otherwise, my posts are always about Gothic 2 Night of the Raven.

Siemekk

Siemekk

Złote Wrota
posty2143
Propsy1154
ProfesjaProgramista
  • Złote Wrota
Nope. Dalej nie działa. Co do skryptu z CZ wziąłem tylko ustawiane Perców oraz zmienne bo zapis jest prostszy. U mnie dmg jest = 0 gdy mam wyposażony kostur lub miecz z innymi obrażeniami. Dodatkowo dzięki zmiennej w c_item mogę określić z czym jest skalowana dana broń np. Rapier-Zręczność, kostur-Mana Etc.

This function using two params:
void DropUnconscious(float,oCNpc*)
{
XCALL(0x00735EB0);
};
 

P.S A Splash w szafie i nie ma psychy by mi dać bana.

Lehona

Lehona

Użytkownicy
posty196
Propsy190
  • Użytkownicy
Indeed, I didn't notice you were using two different addresses (Try using constants instead, your code will become more readable...).

Anyway, according to IDA it's assuming16 Bytes for parameters (although IDA says it expects only a float and an oCNpc*) and it's definitly accessing them all, so there seems to be something weird going on. The only callsite I found was just pushing two parameters, too.

Why are you passing 0f as a parameter? Someone else already wrote a wrapper for that call and they're pushing 1.0f...
http://forum.worldofplayers.de/forum/threads/958221-G2-Fernkampfwaffen-modifizieren/page2?p=15429826&highlight=DropUnconscious#post15429826

And you should probably make sure that you are actually passing valid pointers.
 
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