Ikarus (Pakiet skryptów) 411807 1020

O temacie

Autor orcwarrior

Zaczęty 11.06.2010 roku

Wyświetleń 411807

Odpowiedzi 1020

Siemekk

Siemekk

Złote Wrota
posty2143
Propsy1154
ProfesjaProgramista
  • Złote Wrota
Czy Ikarusem można by dodać funkcje operatorów? Potrzebuje wektorów a w adresach znalazłem wszystko w tym operatory.
zVEC3 & __thiscall zVEC3::operator*=(float)   
Druga sprawa to czy mogę stworzyć taką funkcję?
func zVEC3 Vec3(float, float, float)
//3x params
CALL_RetValAsStructur(12); //zVEC3 size
CALL__thiscall(ptr, adress);
_^(CALL_RetValAsInt());
I trzecia sprawa co by było pointerem w tej funkcji? zVEC3::zVEC3 ... Nie wiem czy istnieje coś takiego jak MEM_GAME tylko dla wektora...

Pozdrawiam.
 

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

Lehona

Lehona

Użytkownicy
posty196
Propsy190
  • Użytkownicy
You can not overload operators in Daedalus (mostly because the related code would be impossible to parse, i.e. the compiler would throw an error and abort.

You can, however, just create a function like zvec3_multiplyscalar(float). If you want to use the existing engine code (although scalar multiplication is really simple and you can just do it in Daedalus), just use it like any other function. Where's the problem? I'm sure you've done this before.
 
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
Znowu mam pytanie. Otóż jeśli argumentem funkcji ma być zVEC3 to czy jako param muszę podać to:
var int vec[3];
/*
Ustaw wartosci
*/
CALL_PtrParam(_@(vec));
CALL__thiscall(ptr, adress);
Oraz dwa, jeżeli mam swoją bibliotekę dll, to aby wywołać stworzoną przeze mnie funkcję to czego mam użyć?
var int lib; lib = LoadLibrary("DLL_Name.dll");
var int funkcja; GetProcAddress(lib, "costam");
I teraz czego użyć?
Call_* ?
Byłbym wdzięczny za pomoc w tych dwóch rzeczach ;)
 

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.
1. Nie jestem co do tego pewny, ale zdaje mi się, że można zrobić tak: int variable; variable = _@(vector3D); gdzie vector3D to twój vec[3], ale zapisany bez nawiasów kwadratowych.

2. Starczy zajrzeć do skryptów orka (CZ), albo poszukać na forum, gdzie było o tym sporo mówione (o samym loadlibrary).
 
: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
I jeszcze jedno bo mi się przypomniało. Czy jak zhookuje funkcję silnika to mogę ją wyłączyć i zastąpić własną?
func void hook()
{
//wylaczenie funkcji
Mojafunkcja();
};

HookEngineF(adress, len, hook);
 

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.
Jak na razie, teoretycznie nie. Praktycznie się da. Musisz wyłączyć wszystkie zmienne ECX, EDI itp. Problem w tym, że nie starczy sam zapis ECX = 0, tylko musisz wyłączyć wszystkie używane, np. ECX+124, ECX+408 itd. Zdaje mi się, że w przyszłości ma się pojawić zastępowanie funkcji w samym hookengine. Jak na razie nie jest to w ogóle opłacalne, żeby wyłączać funkcje manualnie.
 
: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
Hmm a wywołanie funkcji w funkcji coś zmieni? Raczej nie ;/
 

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

Siemekk

Siemekk

Złote Wrota
posty2143
Propsy1154
ProfesjaProgramista
  • Złote Wrota
Czy aby wywołać funkcję ze swojej libki której argumentem jest string muszę użyć
CALL_cStringPtrParam(string);
Gdy użyłem CALL_zStringPtrParam to wywaliło mi grę - chyba wiadomo. zString to gothicowa klasa ._.
 

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.
Z tego co mi wiadomo, to cString i zString to stringi. zString ma tylko dodatkowe zmienne, a cString to okrojony zString.
 
: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
A cString is just a (null-terminated) char*, there's no metadata attached.
 
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
Potrzebowałbym dwóch odpowiedzi, które pomogłyby mi trochę z IDA.
1) Gdzie w adresie jest zapisany HookLen potrzeby do EngineHook'a w Ikarusie? (Byłbym wdzięczny za screen z zaznaczeniem przykładowego adresu i hooklena)
2) Jak rozszyfrować coś takiego:
struct oCNpc *v1; // esi[member=20340]1[/member]
  int v2; // eax@2
  struct oCNpc *result; // eax@5
Ikarus, chcę dostać result więc chodzi o coś takiego?
Hookowana funkcja()
{
var int Result;
Result = MEM_ReadInt(EAX + 5); ?

};

Byłbym wdzięczny za pomoc ;0
 

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

Siemekk

Siemekk

Złote Wrota
posty2143
Propsy1154
ProfesjaProgramista
  • Złote Wrota
Moja mała funkcja do pakietu BroadCasts :) Bardzo dobrze działa do zaklęć obszarowych.

func void DoForRangeEx(var c_npc slf, var func fnc, var int range, var int ReadHero)
{
   // Create array from all oCNpc
var int vobArrayPtr; vobArrayPtr = MEM_ArrayCreate();
var zCArray vobArray; vobArray = _^(vobArrayPtr);

// Search world for all vobs of class oCNpc
const int oCNpc__classDef              = 11214368; //0x00AB1E20
const int zCWorld__SearchVobListByClass =  6439504; //0x624250

var int worldPtr; worldPtr = _@(MEM_World);
const int call = 0; var int zero;
if (CALL_Begin(call)) {
CALL_PtrParam(_@(zero));                // zCTree* (zero == globalVobTree)
CALL_PtrParam(_@(vobArrayPtr));          // Array to collect vobs in
CALL_PtrParam(_@(oCNpc__classDef));    // Search for vobs of that class
CALL__thiscall(_@(worldPtr), zCWorld__SearchVobListByClass);
call = CALL_End();
};

if (!vobArray.numInArray)
{
MEM_ArrayFree(vobArrayPtr);
return;
};

repeat(i, vobArray.numInArray); var int i;

// Search found vobs for the matching instance
var int vobPtr; vobPtr = MEM_ArrayRead(vobArrayPtr, i);
if (!Hlp_Is_oCNpc(vobPtr)) {
continue;
};

var c_npc npc; npc = _^(vobPtr);
if(Npc_GetDistToNpc(npc, slf) <= range)
{
if(vobPtr == _@(slf)
||(vobPtr == _@(hero) && !ReadHero)
||(npc.attribute[0] <= 1)) //No include
{}
else
{
MEM_PushInstParam(slf); //Caster
MEM_PushInstParam(npc); //Znaleziony NPC
MEM_Call(fnc);
};
};
end;
MEM_ArrayFree(vobArrayPtr);
vobArrayPtr = 0;
};

func void DoForRange(var c_npc slf, var func fnc, var int range)
{
DoForRangeEx(slf, fnc, range, false);
};
TYLKO GOTHIC 2 - Nie chciało mi się szukać adresów do G1 ;)
 

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

Siemekk

Siemekk

Złote Wrota
posty2143
Propsy1154
ProfesjaProgramista
  • Złote Wrota
@Splash pakiet Sprite dalej jest zjebany?
 

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

Splash

Splash

Moderator
posty4209
Propsy3412
ProfesjaNierób
  • Moderator
Nie wiem xD
 
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
Mógłbyś rzucić okiem na to?

var int sinApprox; var int cosApprox;
func void SinCosApprox(var int angle) {
    const int sinPtr = 0;
    const int cosPtr = 0;
    if(!sinPtr) {
        sinPtr = _@(sinApprox);
        cosPtr = _@(cosApprox);
    };
    const int call = 0;
    if(CALL_Begin(call)) {
        CALL_PtrParam(_@(cosPtr));
        CALL_PtrParam(_@(sinPtr));
        CALL_FloatParam(_@(angle));
        CALL__cdecl(zSinCosApprox);

        call = CALL_End();
    };
};

func void zRND_D3D_DrawPolySimple(var int zCTexturePtr, var int zTRndSimpleVertexPtr, var int num) {
    const int call = 0;
    if(CALL_Begin(call)) {
        CALL_IntParam(_@(num));
        CALL_PtrParam(_@(zTRndSimpleVertexPtr));
        CALL_PtrParam(_@(zCTexturePtr));

        CALL__thiscall(zrenderer_adr, zRND_D3D__DrawPolySimple);

        call = CALL_End();
    };
};

func void zRND_D3D_DrawLine(var int x0, var int y0, var int x1, var int y1, var int color) {
    const int call = 0;
    if(CALL_Begin(call)) {
        CALL_IntParam(_@(color));
        CALL_FloatParam(_@(y1));
        CALL_FloatParam(_@(x1));
        CALL_FloatParam(_@(y0));
        CALL_FloatParam(_@(x0));

        CALL__thiscall(zrenderer_adr, zRND_D3D__DrawLine);

        call = CALL_End();
    };
};

func int zRND_D3D_GetTotalTextureMem() {
    return MEM_ReadInt(zrenderer_adr + zRND_D3D_TexMemory_offset);
};

func void zRND_D3D_SetAlphaBlendFunc(var int zTRnd_AlphaBlendFunc) {
    const int ptr = 0;
    if(!ptr) {
        ptr = _@(zTRnd_AlphaBlendFunc);
    };
    const int call = 0;
    if(CALL_Begin(call)) {
        CALL_IntParam(_@(ptr));
        CALL__thiscall(zrenderer_adr, zRND_D3D__SetAlphaBlendFunc);

        call = CALL_End();
    };
};

const int zRND_ALPHA_FUNC_MAT_DEFAULT = 0;
const int zRND_ALPHA_FUNC_NONE        = 1;
const int zRND_ALPHA_FUNC_BLEND       = 2;
const int zRND_ALPHA_FUNC_ADD         = 3;
const int zRND_ALPHA_FUNC_SUB         = 4;
const int zRND_ALPHA_FUNC_MUL         = 5;
const int zRND_ALPHA_FUNC_MUL2        = 6;
const int zRND_ALPHA_FUNC_TEST        = 7;
const int zRND_ALPHA_FUNC_BLEND_TEST  = 8;


func void zRND_XD3D_SetRenderState(var int state, var int mode) {
    const int call = 0;
    if(CALL_Begin(call)) {
        CALL_IntParam(_@(mode));
        CALL_IntParam(_@(state));

        CALL__thiscall(zrenderer_adr, zCRnd_D3D__XD3D_SetRenderState);

        call = CALL_End();
    };
};

const int D3DRS_ZENABLE = 7;


class zTRndSimpleVertex {
    var int pos[2];
    var int z;
    var int uv[2];
    var int color;
};
const int sizeof_zTRndSimpleVertex = 6 * 4;

class gCSprite {
    var int x;      // float
    var int y;      // float
    var int width;  // float
    var int height; // float
    var int hidden; // bool
    var int prio;
    var string textureName;
    var int buf;    // zCArray*

    var int texture; // zCTexture*
    var int sin; // float (sin(rot)
    var int cos; // float (cos(rot))
    var int stream; // int* (buf->array)
};

const string gCSprite_Struct = "auto|7 zCArray* void|4";

instance gCSprite@(gCSprite);

var int m_arrSprite; //zCArray<gCSprite*>

func void _Sprite_CalcZ(var gCSprite s) {
    var int off; off = s.stream;
    var int i; i = 0;
    repeat(i, 4);
        MEM_WriteInt(off+8, floatEins);
        off += sizeof_zTRndSimpleVertex;
    end;
};

func void _Sprite_CalcRotMat(var gCSprite s, var int x, var int y, var int resPtr) {
    MEM_WriteInt(resPtr,     subf(mulf(x, s.cos), mulf(y, s.sin)));
    MEM_WriteInt(resPtr + 4, addf(mulf(x, s.sin), mulf(y, s.cos)));
};

func void _Sprite_CalcRotForVert(var gCSprite s, var int v, var int x, var int y) {
    var int resPtr; resPtr = s.stream + v * sizeof_zTRndSimpleVertex;
    MEM_WriteInt(resPtr,     addf(s.x, subf(mulf(x, s.cos), mulf(y, s.sin))));
    MEM_WriteInt(resPtr + 4, addf(s.y, addf(mulf(x, s.sin), mulf(y, s.cos))));
};

func void _Sprite_CalcPos(var gCSprite s) {
    var int wh; wh = mulf(s.width, floatHalb);
    var int hh; hh = mulf(s.height, floatHalb);
    var int nwh; nwh = negf(wh);
    var int nhh; nhh = negf(hh);

    s.stream = MEM_ReadInt(s.buf);

    _Sprite_CalcRotForVert(s, 0, nwh, nhh);
    _Sprite_CalcRotForVert(s, 1,  wh, nhh);
    _Sprite_CalcRotForVert(s, 2,  wh,  hh);
    _Sprite_CalcRotForVert(s, 3, nwh,  hh);
};

func void _Sprite_NewBuf(var gCSprite s) {
    s.buf = MEM_ArrayCreate();
    var zCArray arr; arr = _^(s.buf);
    arr.numInArray = sizeof_zTRndSimpleVertex;
    arr.numAlloc = sizeof_zTRndSimpleVertex;
    arr.array = MEM_Alloc(4 * sizeof_zTRndSimpleVertex);
};

//========================================
// UV eines Vertex
//========================================
func void Sprite_SetVertUV(var int h, var int vert, var int x, var int y) {
    if(vert < 0 || vert > 3) { return; };
    var gCSprite s; s = get(h);
    var int off; off = MEM_ReadInt(s.buf) + vert * sizeof_zTRndSimpleVertex;
    MEM_WriteInt(off + 12, x);
    MEM_WriteInt(off + 16, y);
};

//========================================
// UV eines Sprites
//========================================
func void Sprite_SetUV(var int h, var int x0, var int y0, var int x1, var int y1) {
    var gCSprite s; s = get(h);
    var int off; off = MEM_ReadInt(s.buf);
    MEM_WriteInt(off + 12, x0);
    MEM_WriteInt(off + 16, y0);
    off += sizeof_zTRndSimpleVertex;
    MEM_WriteInt(off + 12, x1);
    MEM_WriteInt(off + 16, y0);
    off += sizeof_zTRndSimpleVertex;
    MEM_WriteInt(off + 12, x1);
    MEM_WriteInt(off + 16, y1);
    off += sizeof_zTRndSimpleVertex;
    MEM_WriteInt(off + 12, x0);
    MEM_WriteInt(off + 16, y1);
};

//========================================
// Farbe eines Vertex
//========================================
func void Sprite_SetVertColor(var int h, var int vert, var int col) {
    if(vert < 0 || vert > 3) { return; };
    var gCSprite s; s = get(h);
    MEM_WriteInt(MEM_ReadInt(s.buf) + vert * sizeof_zTRndSimpleVertex + 20, col);
};

//========================================
// Farbe eines Sprites
//========================================
func void Sprite_SetColor(var int h, var int col) {
    var gCSprite s; s = get(h);
    var int off; off = MEM_ReadInt(s.buf);
    var int i; i = 0;
    repeat(i, 4);
        MEM_WriteInt(off + 20, col);
        off += sizeof_zTRndSimpleVertex;
    end;
};

//========================================
// Priorität eines Sprites
//========================================
func void Sprite_SetPrio(var int h, var int prio) {
    var gCSprite s; s = get(h);
    if(s.prio == prio) { return; };
    s.prio = prio;

if(m_arrSprite)
{
    MEM_ArraySortFunc(m_arrSprite, _Sprite_PrioComparer);
};
};
func int _Sprite_PrioComparer(var int l, var int r) {
    var gCSprite sl; sl = get(l);
    var gCSprite sr; sr = get(r);
    return sl.prio - sr.prio;
};

//========================================
// Position eines Sprites
//========================================
func void Sprite_SetPosPxlF(var int h, var int xf, var int yf) {
    var gCSprite s; s = get(h);
    s.x = xf;
    s.y = yf;
    _Sprite_CalcPos(s);
};

func void Sprite_SetPosPxl(var int h, var int x, var int y) {
    Sprite_SetPosPxlF(h, mkf(x), mkf(y));
};

func void Sprite_SetPos(var int h, var int x, var int y) {
    Sprite_SetPosPxlF(h, Print_ToPixel(x, PS_X), Print_ToPixel(y, PS_Y));
};

//========================================
// Rotation eines Sprites
//========================================
func void Sprite_SetRotationSC(var int h, var int sin, var int cos) {
    var gCSprite s; s = get(h);
    s.sin = sin;
    s.cos = cos;
    _Sprite_CalcPos(s);
};

func void Sprite_SetRotationR(var int h, var int r) {
    var gCSprite s; s = get(h);
    SinCosApprox(r);
    s.sin = sinApprox;
    s.cos = cosApprox;
    _Sprite_CalcPos(s);
};

func void Sprite_SetRotation(var int h, var int r) {
    Sprite_SetRotationR(h, Print_ToRadian(mkf(r)));
};

//========================================
// Rotieren eines Sprites
//========================================
func void Sprite_RotateR(var int h, var int r) {
    var gCSprite s; s = get(h);
    SinCosApprox(r);
    var int res[2];
    _Sprite_CalcRotMat(s, cosApprox, sinApprox, _@(res));
    s.cos = res[0];
    s.sin = res[1];
    _Sprite_CalcPos(s);
};
func void Sprite_Rotate(var int h, var int r) {
    Sprite_RotateR(h, Print_ToRadian(mkf(r)));
};

//========================================
// Breite eines Sprites setzen
//========================================
func void Sprite_SetWidthPxl(var int h, var int w) {
    var gCSprite s; s = get(h);
    s.width = mkf(w);
    _Sprite_CalcPos(s);
};
func void Sprite_SetWidth(var int h, var int w) {
    Sprite_SetWidthPxl(h, Print_ToVirtual(w, PS_X));
};

//========================================
// Höhe eines Sprites setzen
//========================================
func void Sprite_SetHeightPxl(var int h, var int hg) {
    var gCSprite s; s = get(h);
    s.height = mkf(hg);
    _Sprite_CalcPos(s);
};

func void Sprite_SetHeight(var int h, var int hg) {
    Sprite_SetHeightPxl(h, Print_ToVirtual(hg, PS_Y));
};

//========================================
// Breite und Höhe eines Sprites setzen
//========================================
func void Sprite_SetDimPxl(var int h, var int w, var int hg) {
    var gCSprite s; s = get(h);
    s.width = mkf(w);
    s.height = mkf(hg);
    _Sprite_CalcPos(s);
};
func void Sprite_SetDim(var int h, var int w, var int hg) {
    Sprite_SetDimPxl(h, Print_ToPixel(w, PS_X), Print_ToPixel(hg, PS_Y));
};

//========================================
// Sprite skalieren
//========================================
func void Sprite_Scale(var int h, var int x, var int y) {
    var gCSprite s; s = get(h);
    s.width = mulf(s.width, x);
    s.height = mulf(s.height, y);
    _Sprite_CalcPos(s);
};

//========================================
// Sprite verstecken
//========================================
func void Sprite_SetVisible(var int h, var int visible) {
    var gCSprite s; s = get(h);
    s.hidden = !visible;
};

//========================================
// Sprite erstellen
//========================================
func int Sprite_CreatePxl(var int x, var int y, var int width, var int height, var int color, var string tex) {
    var int h; h = new(gCSprite@);
    var gCSprite s; s = get(h);

    s.buf = MEM_ArrayCreate();

    s.x = mkf(x);
    s.y = mkf(y);
    s.width = mkf(width);
    s.height = mkf(height);
    s.textureName = tex;

    _Sprite_NewBuf(s);

    Sprite_SetColor(h, color);
    Sprite_SetUV(h, floatNull, floatNull, floatEins, floatEins);
    Sprite_SetRotationSC(h, floatNull, floatEins);

    _Sprite_CalcPos(s);
    _Sprite_CalcZ(s);

if(!m_arrSprite)
{
m_arrSprite = MEM_ArrayCreate();
};

MEM_ArrayInsert(m_arrSprite, h);

    return h;
};

func int Sprite_Create(var int x, var int y, var int width, var int height, var int color, var string tex) {
    Sprite_CreatePxl(Print_ToPixel(x, PS_X), Print_ToPixel(y, PS_Y), Print_ToPixel(width, PS_X), Print_ToPixel(height, PS_Y), color, tex);
};


func void Sprite_Delete(var int hndl)
{
if(!m_arrSprite)
{
return;
};

if(MEM_ArraySize(m_arrSprite))
{
MEM_ArrayRemoveValue(m_arrSprite, hndl);
delete(hndl);
if(MEM_ArraySize(m_arrSprite) <= 0)
{
MEM_ArrayClear(m_arrSprite);
m_arrSprite = 0;
};
};

};

//========================================
// Sprite rendern
//========================================
func void Sprite_Render(var int i) {
   
var int ptr; ptr = MEM_ArrayRead(m_arrSprite, i);
if(!Hlp_IsValidHandle(ptr))
{
return;
};

var gCSprite s; s = get(ptr);
    if(s.hidden) {
        return;
    };
    if(!s.texture) {
        s.texture = zCTexture_Load(s.textureName);
    };
    zRND_D3D_DrawPolySimple(s.texture, MEM_ReadInt(s.buf), 4);
};

//========================================
// [intern] alle Sprites rendern
//========================================
func void _Sprite_DoRender() {
    if(!Hlp_IsValidNpc(hero)) { return; }; // Vielen Dank an Sektenspinner für diesen "Hack"

if(!m_arrSprite)
{
return;
};

if(!MEM_ArraySize(m_arrSprite))
{
return;
};

    zRND_XD3D_SetRenderState(D3DRS_ZENABLE, false); // Disable depthbuffer

    zRND_D3D_SetAlphaBlendFunc(zRND_ALPHA_FUNC_BLEND);

var int i; i = 0;
var int loop; loop = MEM_StackPos.position;

if(i < MEM_ArraySize(m_arrSprite))
{
Sprite_Render(i);
i+=1;
MEM_StackPos.position = loop;
};
    zRND_XD3D_SetRenderState(D3DRS_ZENABLE, true); // Enable depthbuffer
};
Podmieniłem to na zCArray i już nie crashuje przy zmianie świata czy zapisywaniu. W skrypcie twojego kompasu z WoG'a (Używałem go do testów :D) widziałem, że używałeś delete(compass_arrow); W tym co podesłałem zastąp tym - Sprite_Delete(var int hndl);
Jestem ciekawy, czy nie wywali.... A i jeszcze podmień to w Ikarus.d (nie wiem czemu nie była sprawdzana wartość pointera przed funkcją :F)
func int MEM_ArrayCreate () {
    return MEM_Alloc (sizeof_zCArray);
};

func void MEM_ArrayFree(var int zCArray_ptr) {

if(!zCArray_ptr) {
return;
};

var int array; array = MEM_ReadInt (zCArray_ptr);

    if (array) {
        MEM_Free (array);
    };

    MEM_Free (zCArray_ptr);
};

func void MEM_ArrayClear (var int zCArray_ptr) {
   
if(!zCArray_ptr) {
return;
};
var zCArray array;
    array = _^(zCArray_ptr);

    if (array.array) {
        MEM_Free (array.array);
        array.array = 0;
    };

    array.numAlloc = 0;
    array.numInArray = 0;
};

func int MEM_ArraySize(var int zCArray_ptr)
{
if(!zCArray_ptr) {
return 0;
};
return MEM_ReadInt(zCArray_ptr + 8);
};

func void MEM_ArrayWrite(var int zCArray_ptr, var int pos, var int value) {

if(!zCArray_ptr) {
return;
};

var zCArray array;
    array = _^(zCArray_ptr);
   
    if (pos < 0 || array.numInArray <= pos) {
        MEM_Error (ConcatStrings("MEM_ArrayWrite: pos out of bounds: ", IntToString(pos)));
        return;
    };
   
    MEM_WriteIntArray(array.array, pos, value);
};

func int MEM_ArrayRead(var int zCArray_ptr, var int pos) {
   
if(!zCArray_ptr) {
return 0;
};
var zCArray array; array = _^(zCArray_ptr);
   
    if (pos < 0 || array.numInArray <= pos) {
        MEM_Error (ConcatStrings("MEM_ArrayRead: pos out of bounds: ", IntToString(pos)));
        return 0;
    };
   
    return MEM_ReadIntArray(array.array, pos);
};

 

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

Splash

Splash

Moderator
posty4209
Propsy3412
ProfesjaNierób
  • Moderator
W końcu wyszła wersja 2.5.0 pakietu LeGo, a wraz z nią wiele nowych bajerów:
  • Oficjalne wsparcie dla Gothic 1 (niektóre pakiety wciąż są eksperymentalne)
  • Przebudowany HookEngine
  • Draw3D - jeśli dobrze rozumiem, pozwala tworzyć trójwymiarowe sześciany
  • Komendy pakietu ConsoleCommands nie są już rejestrowane w zapisie gry, dzięki czemu nie występują problemy z ich działaniem po wczytaniu zapisu
  • Funkcje pozwalające wyłączać lub podmieniać funkcje silnika
  • Naprawiono błąd powodujący blokowanie się Npc po zakończeniu trialogu
  • Naprawiono problemy związane z pakietem PermMem i innymi pakietami opierającymi się o niego podczas zmiany świata
  • Nowe funkcje pakietu List (List_AddFront*)
  • Nowa funkcja pakietu View (View_AddTextColored)
  • Drobne poprawki w pakietach Anim8, Bloodspats, Interface, zCViewText oraz Arrays

https://forum.worldofplayers.de/forum/threads/1505251-Skriptpaket-LeGo-4
 
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
posty1624
Propsy135
ProfesjaSkrypter
  • Użytkownicy
mozna by napisac jak zaimplementowac pakiet "wolnce celowanie" do moda?
 

Splash

Splash

Moderator
posty4209
Propsy3412
ProfesjaNierób
  • Moderator
 
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
posty1624
Propsy135
ProfesjaSkrypter
  • Użytkownicy
blink zauber działa tylko pod g1?
https://www.worldofgothic.de/?go=moddb&action=view&fileID=1331
 

Siemekk

Siemekk

Złote Wrota
posty2143
Propsy1154
ProfesjaProgramista
  • Złote Wrota
Pod Gothic 2 bo:
- PFX działają trochę inaczej niż w Gothic 1 (mogę się mylić)
- Adresy do tworzenia waypointów są z Gothic 2.
- Offsety mogą być inne niż w Gothic 1 (nie wiem czy są tam offsety)
- I z tego co pamiętam MEM_PtrToInst w Gothic 1 miało jakieś problemy.
 

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


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