Ikarus (Pakiet skryptów) 413225 1020

O temacie

Autor orcwarrior

Zaczęty 11.06.2010 roku

Wyświetleń 413225

Odpowiedzi 1020

pawbuj

pawbuj

Użytkownicy
posty1625
Propsy135
ProfesjaSkrypter
  • Użytkownicy

pawbuj

Ikarus (Pakiet skryptów)
#140 2011-06-07, 20:43(Ostatnia zmiana: 2011-06-07, 21:46)
Ehh ten mój skrypt jest pod gothic 1
powinieneś wywalić enginehook dać funkcję focuscolor do tictocka sprawdzić czy dalej są błędy
robię ta pustą skrzynię i działa! tylko tyle, że jak ją opróżnię i ponownie uzupełnię to nadal jest pusta. rozumiem,że tego nie przewidziałeś?

wywaliłem hookengine z gothic.src i nadal wywala error dostack przy focuscolor (cholera!), mam ikariusa 1.1.1
 

pawbuj

pawbuj

Użytkownicy
posty1625
Propsy135
ProfesjaSkrypter
  • Użytkownicy
Ikarus od dłuższego czasu jest we wspólnej wersji, podajesz parserowi po prostu odpowiednią wersję pliku z adresami. Zdecydowanie radzę pobierać tylko najnowszą wersję z oficjalnego tematu na forum WoG, wersja Orca była co prawda dokonaniem, ale autor Ikarusa już sam wszystko dopracował.
mam wersję 1.1.1 i taka znalazłem, jest aktualniejsza?
 


Lehona

Lehona

Użytkownicy
posty196
Propsy190
  • Użytkownicy

Lehona

Ikarus (Pakiet skryptów)
#143 2011-06-08, 11:52(Ostatnia zmiana: 2011-06-08, 14:37)
You get a DoStack-Error? Please show me your exact script this is related to.

I will release "soon" (so, a non-definite date :p) a new Version of the Hooks which grants more possibilites. You should use it instead of OrcWarrior's version... To port it to Gothic 1 you just need to swap out 1 or 2 addresses, OrcWarrior did this already in the version which is around here.

@Sawik: Are you still interested in the way the FocusColor works?

The Hook makes sure that everytime, the focusname is printed on the screen (or, in fact, some instructions before) we change the "pen" (or the pen color) the Engine "writes" with. We check out the attitude and set the zCColor (Therefore there is a RGBA-Function, to transform RGBA-Values into an integer). It's really not that complicated (if you don't want to know how the hook works, at least). The only thing you have to do when you want to transform it to Gothic 1, you need to find the exact address before the name is printed. That's not easy if you don't understand IDA at all, but I guess OrcWarrior is quite good at it (And has access to an .exe which has enough Debug-Information in it... I never bothered to disassemble the G1.exe)...
 
Unless specified otherwise, my posts are always about Gothic 2 Night of the Raven.

Shothic

Shothic

Użytkownicy
posty38
Propsy17
  • Użytkownicy
pawbuj przewidziałem i to i w moim skrypcie dodałem ten warunek
tutaj masz poprawkę ;]
Spoiler
func void ChestRename() {
        var oCMob Mob;
        var oCMobContainer Skrzynia;
        var oCNpc her; her = Hlp_GetNpc(pc_hero);
        var string newName; newName = "Pusta Skrzynia";
        var int NameSymbIndex;
        var string OldName; OldName = "Skrzynia";
        if(her.focus_vob)
        {
                if(MEM_ReadInt(her.focus_vob)==oCMobContainer_vtbl)
                {
                        MEM_AssignContentInst (Mob,her.focus_vob);
                        MEM_AssignContentInst (Skrzynia,her.focus_vob);
                        if (MEM_ReadInt(MEM_InstToPtr(Skrzynia)+604) == 0)
                        {
                                MEM_ReinitParser();      
                                NameSymbIndex = MEM_FindParserSymbol("CHESTRENAME.NEWNAME"); // NAME OF THE VARIABLE!
                                Mob.focusNameIndex = NameSymbIndex;
                         } else {
                                MEM_ReinitParser();      
                                NameSymbIndex = MEM_FindParserSymbol("CHESTRENAME.OLDNAME"); // NAME OF THE VARIABLE!
                                Mob.focusNameIndex = NameSymbIndex;
                         };
                };
        };
};

 

pawbuj

pawbuj

Użytkownicy
posty1625
Propsy135
ProfesjaSkrypter
  • Użytkownicy

pawbuj

Ikarus (Pakiet skryptów)
#145 2011-06-08, 18:06(Ostatnia zmiana: 2011-06-08, 18:07)
You get a DoStack-Error? Please show me your exact script this is related to.

I will release "soon" (so, a non-definite date :p) a new Version of the Hooks which grants more possibilites. You should use it instead of OrcWarrior#msg151110s version... To port it to Gothic 1 you just need to swap out 1 or 2 addresses, OrcWarrior did this already in the version which is around here.

@Sawik: Are you still interested in the way the FocusColor works?

The Hook makes sure that everytime, the focusname is printed on the screen (or, in fact, some instructions before) we change the "pen" (or the pen color) the Engine "writes" with. We check out the attitude and set the zCColor (Therefore there is a RGBA-Function, to transform RGBA-Values into an integer). It#msg151110s really not that complicated (if you don#msg151110t want to know how the hook works, at least). The only thing you have to do when you want to transform it to Gothic 1, you need to find the exact address before the name is printed. That#msg151110s not easy if you don#msg151110t understand IDA at all, but I guess OrcWarrior is quite good at it (And has access to an .exe which has enough Debug-Information in it... I never bothered to disassemble the G1.exe)...
Lehona, many thanks for interesting our topic.
I think both me and Sawik will be grateful if you help us to use focuscolor due to Npc attitude and chest #msg151110 color when locked/opened.

I hope OrcWarrior will let us know what amended changes need to be placed in file hookengine.d to do this thing properly.

Having occasion to ask you please advice:
 the function RGBA can be placed in ikarus.d or other file?
- functions using key press can be placed in tick tock  ? - where are they definied for g1?
how to run file hookengine.d,will be enough from following script in startup.d:

FUNC VOID INIT_WORLD ()
{
   INIT_Sub_Newcamp      ();
   INIT_Sub_Oldcamp      ();
   INIT_Sub_Psicamp      ();
   INIT_Sub_Demontower    ();
   INIT_Sub_Freeminecamp   ();
   INIT_Sub_Surface       ();
   Init_Global();

where initglobal is :

func void Init_Global()
{
   if (!Hlp_StrCmp(Gothic_Restarted, "Yes"))
   {
        HookEngine(oCGame__UpdateStatus_X,              8, "EVT_UpdateStatus_FocusName");
 
Gothic_Restarted = "Yes";
      // Hook
   };
};



thanks in advance
 

Wowoz

Wowoz

Użytkownicy
Wowoźny
posty3698
Propsy4862
NagrodyVV
Profesjabrak
  • Użytkownicy
  • Wowoźny
Ty to tlumaczysz w translatorze?
 

pawbuj

pawbuj

Użytkownicy
posty1625
Propsy135
ProfesjaSkrypter
  • Użytkownicy

pawbuj

Ikarus (Pakiet skryptów)
#147 2011-06-08, 18:13(Ostatnia zmiana: 2011-06-08, 20:14)
Ty to tlumaczysz w translatorze?
nie i chyba nie kaleczę. chcesz o takich sprawach pogadać to PW.tu skupiamy się na problemach związanych z ikariusem.
 oba posty chyba na śmietnik - niczego tu nie wnoszą.


Od stwierdzenia czy wnoszą lub nie i czy jest śmietnik, jestem ja
 

Sawik

Sawik

Moderator działu
Rebel
posty4772
Propsy3197
ProfesjaNierób
  • Moderator działu
  • Rebel
@Lehona Well i think i made a "little" misstatement as i didnt say im looking for a way to do it for Gothic 2 i heard that its already done and published so everyone can use it but im still learning scripts and i decided to write my own as im learning the most by correcting mistakes i expect tons of mistakes and i do know its gonna take ages but i got a lot of time to spare.

WWZ pisałeś mi wcześniej że analizując skrypt uczę się. Wyżej jest odpowiedź ale nie wiem jak z twoim angielskim więc powiem jeszcze raz: uczę się najwięcej poprawiając błędy które zrobiłem i dlatego próbuję (bardziej precyzyjne będę próbował) napisać własny skrypt na zmianę kolorów.
 
Życzę wam seksu analnego po stronie biernej.
Dropbox +500 mb na start
LowPoly
Wykonanie modelu niskopoligonowego to sztuka kompromisu. Nie jest to jedynie uproszczenie modelu wysokopoligonowego, ale głęboka modyfikacja oraz podejmowanie decyzji często zmieniających wygląd pierwotny obiektu, tak by przy najmniejszej ilości trójkątów uzyskać jak najwierniej odwzorowany kształt oryginału. Nie można też zapomnieć o tym iż musi nadal wyglądać przekonywająco i tak balansować by uzyskać efekt optymalny.

Podstawowym założeniem jest, że model nie powinien mieć zbędnych, niewidocznych dla gracza detali włączonych w geometrie. Większość obiektów jakie znajdują się w grze powinna prezentować się najlepiej z odległości około 3-5 metrów. Wszelkie detale, które zanikają, wydają się płaskie lub zlewają się z bryłą modelu należy uznać za zbędne i pozostawić je na normal mapie.

Fakt, iż gracz będzie w stanie podejść bliżej do obiektu i zobaczyć go z mniejszej niż 3m odległości nie powinno stanowić większego problemu, gdyż większą rolę odgrywają wtedy tekstury oraz dodatkowy detal zależny od materiału obiektu. To właśnie kompromis między wydajnością, a szczegółowością otoczenia.

Detal, którego nie widać z 3-5 metrów nie powinnien istnieć w geometrii modelu.
Krawędzie znajdujące się blisko siebie, które zlewają się z większej odległości należy uprościć do wspólnej płaszczyzny

pawbuj

pawbuj

Użytkownicy
posty1625
Propsy135
ProfesjaSkrypter
  • Użytkownicy
Lehona, here is script published by Shothic regarding changing color of the chests.
 

I had placed this to TICKTock and the game after few seconds of running informs about the error : do stack.
func void FocusColor() {
 
    var oCNpc her;
    her = Hlp_GetNpc (hero);
 
    var int ptr;  
    var oCMobLockable Zamek;
    Zamek = MEM_PtrToInst (her.focus_vob);
 
    var int col;
    const int zCView__SetFontColor = 7339392; //0x6FFD80 Changed
 
 
    if (!her.focus_vob) {
    col = RGBA(255,255,255,255); //Weiß
    ptr = MEM_Alloc(4);
    MEM_WriteInt(ptr, col);
    CALL_IntParam(ptr);
    CALL__thiscall(MEM_ReadInt(screen_offset), zCView__SetFontColor);
    MEM_Free(ptr);
        return;
    };
     
    if (!Hlp_Is_oCMobLockable(her.focus_vob))  
    {
    return;
    } else  
    {
 
    };
 
 
 
    if (Zamek.bitfield & oCMobLockable_bitfield_locked)  
    {
    col = RGBA(255,180,0,255); //Orange
    } else
    {
    col = RGBA(255,255,255,255); //Weiß
    };
 
    ptr = MEM_Alloc(4);
    MEM_WriteInt(ptr, col);
    CALL_IntParam(ptr);
    CALL__thiscall(MEM_ReadInt(screen_offset), zCView__SetFontColor);
    MEM_Free(ptr);
 
};
 


pawbuj

pawbuj

Użytkownicy
posty1625
Propsy135
ProfesjaSkrypter
  • Użytkownicy
else
{

};
To jest raczej niepotrzebne ;p
nie zmienia to faktu , że nadal wywala error do stack (line 175) (przy uruchomieniu funkcji z tick tocka)
 

Shothic

Shothic

Użytkownicy
posty38
Propsy17
  • Użytkownicy
Funkcja jest cały czas wywoływana i to może być problem
zamień tą starą tą poniżej
Spoiler
func void FocusColor() {

    var oCNpc her;  her = Hlp_GetNpc (hero);
    var int ptr;
    var oCMobLockable Zamek;  Zamek = MEM_PtrToInst (her.focus_vob);
    var int col;
    var int Is;
    const int zCView__SetFontColor = 7339392; //0x6FFD80
    PrintScreen (inttostring(is), 25,50,"FONT_OLD_20_WHITE.TGA",1);


   if (!her.focus_vob) {
        if (is == 1)
        {
        is = 0;    
        PrintScreen (inttostring(ptr), 50,50,"FONT_OLD_20_WHITE.TGA",1);
        col = RGBA(255,255,255,255); //Weiß
        ptr = MEM_Alloc(4);
        MEM_WriteInt(ptr, col);
        CALL_IntParam(ptr);
        CALL__thiscall(MEM_ReadInt(screen_offset), zCView__SetFontColor);
        MEM_Free(ptr);    
        };              
   } else {
               if (Hlp_Is_oCMobLockable(her.focus_vob))
               {
                         if (Zamek.bitfield & oCMobLockable_bitfield_locked)
                         {
                         col = RGBA(255,180,0,255); //Orange
                         } else {
                         col = RGBA(255,255,255,255); //Weiß
                         };
               Is = 1;
               ptr = MEM_Alloc(4);
               MEM_WriteInt(ptr, col);
               CALL_IntParam(ptr);
               CALL__thiscall(MEM_ReadInt(screen_offset), zCView__SetFontColor);
               MEM_Free(ptr);
               };

          };

};
 

pawbuj

pawbuj

Użytkownicy
posty1625
Propsy135
ProfesjaSkrypter
  • Użytkownicy
Funkcja jest cały czas wywoływana i to może być problem
zamień tą starą tą poniżej
Spoiler
func void FocusColor() {

    var oCNpc her;  her = Hlp_GetNpc (hero);
    var int ptr;
    var oCMobLockable Zamek;  Zamek = MEM_PtrToInst (her.focus_vob);
    var int col;
    var int Is;
    const int zCView__SetFontColor = 7339392; //0x6FFD80
    PrintScreen (inttostring(is), 25,50,"FONT_OLD_20_WHITE.TGA",1);


   if (!her.focus_vob) {
        if (is == 1)
        {
        is = 0;    
        PrintScreen (inttostring(ptr), 50,50,"FONT_OLD_20_WHITE.TGA",1);
        col = RGBA(255,255,255,255); //Weiß
        ptr = MEM_Alloc(4);
        MEM_WriteInt(ptr, col);
        CALL_IntParam(ptr);
        CALL__thiscall(MEM_ReadInt(screen_offset), zCView__SetFontColor);
        MEM_Free(ptr);    
        };              
   } else {
               if (Hlp_Is_oCMobLockable(her.focus_vob))
               {
                         if (Zamek.bitfield & oCMobLockable_bitfield_locked)
                         {
                         col = RGBA(255,180,0,255); //Orange
                         } else {
                         col = RGBA(255,255,255,255); //Weiß
                         };
               Is = 1;
               ptr = MEM_Alloc(4);
               MEM_WriteInt(ptr, col);
               CALL_IntParam(ptr);
               CALL__thiscall(MEM_ReadInt(screen_offset), zCView__SetFontColor);
               MEM_Free(ptr);
               };

          };

};
dzięki za chęć pomocy ale to samo (wywołuję z tick tocka)
 

Lehona

Lehona

Użytkownicy
posty196
Propsy190
  • Użytkownicy
Don't call this function in your trigger / tick tocka.

Use this function-call (in the way pawbuj showed you some posts ago):


HookEngine(oCGame__UpdateStatus_X, 8, "FOCUSCOLOR");

But if you want it to work for G1, you need to get the correct address (oCGame__UpdateStatus_X is a constant value designed for G2 by me/Gottfried). Orcwarrior might look it up.
Also, if you call it the way pawbuj showed, it will only work outdoor, just call INIT_Global() from the other Inits, too.

Again: This will not work for G1 yet cause the address is wrong!

@Sawik: Do you want to do anything from scratch? Even the hooks? I'd advice you not to do so. To understand or develop something like the Engine-Hooks, you need some knowledge in machinecode/opcodes/assembler, nothing necessy to be a programmer (or a scripter for gothic). If you just want to make the event-function from scratch... Feel free to do so and ask if any problem you can't solve comes up :)
 
Unless specified otherwise, my posts are always about Gothic 2 Night of the Raven.

pawbuj

pawbuj

Użytkownicy
posty1625
Propsy135
ProfesjaSkrypter
  • Użytkownicy

pawbuj

Ikarus (Pakiet skryptów)
#155 2011-06-08, 21:41(Ostatnia zmiana: 2011-06-08, 21:42)
Don#msg151145t call this function in your trigger / tick tocka.

Use this function-call (in the way pawbuj showed you some posts ago):


HookEngine(oCGame__UpdateStatus_X, 8, "FOCUSCOLOR");

But if you want it to work for G1, you need to get the correct address (oCGame__UpdateStatus_X is a constant value designed for G2 by me/Gottfried). Orcwarrior might look it up.
Also, if you call it the way pawbuj showed, it will only work outdoor, just call INIT_Global() from the other Inits, too.

Again: This will not work for G1 yet cause the address is wrong!

@Sawik: Do you want to do anything from scratch? Even the hooks? I#msg151145d advice you not to do so. To understand or develop something like the Engine-Hooks, you need some knowledge in machinecode/opcodes/assembler, nothing necessy to be a programmer (or a scripter for gothic). If you just want to make the event-function from scratch... Feel free to do so and ask if any problem you can#msg151145t solve comes up :)
thanks for the answer.
as far as I understood this function CAN NOT work properly on G1 till the value oCGame__UpdateStatus_X[/i] will be well definied for G1.

Orc jeżeli wiesz jak zdefinowac ta wartość dla G1 , to będę wdzięczny, bo tego na pewno sam nie zrobię.
 

Lehona

Lehona

Użytkownicy
posty196
Propsy190
  • Użytkownicy
That's exactly what it means. If I got nothing to do in the future I might look it up by myself, but actually I'm quite busy (Means: Whenever I'm motivated to work on Gothic).
 
Unless specified otherwise, my posts are always about Gothic 2 Night of the Raven.

pawbuj

pawbuj

Użytkownicy
posty1625
Propsy135
ProfesjaSkrypter
  • Użytkownicy
That#msg151159s exactly what it means. If I got nothing to do in the future I might look it up by myself, but actually I#msg151159m quite busy (Means: Whenever I#msg151159m motivated to work on Gothic).
ok, keep in  touch
 

Sawik

Sawik

Moderator działu
Rebel
posty4772
Propsy3197
ProfesjaNierób
  • Moderator działu
  • Rebel
@Sawik: Do you want to do anything from scratch? Even the hooks? I#msg151145d advice you not to do so. To understand or develop something like the Engine-Hooks, you need some knowledge in machinecode/opcodes/assembler, nothing necessy to be a programmer (or a scripter for gothic). If you just want to make the event-function from scratch... Feel free to do so and ask if any problem you can#msg151145t solve comes up :)
I think you are right it would be too hard for me and when i think about it, it looks more and more like a huge waste of time because most likely I will never finish it at some point I#msg151145ll stuck and i won#msg151145t be able to solve it and there is no point in doing it as its already done and even if I#msg151145ll do my own and learn how to do it it will be done only once as i don#msg151145t think I#msg151145m going to do it for every modification separately. In that matter of fact I think I#msg151145m only going to analyze script which is already done and see how much I#msg151145ll learn out of it. Thanks for showing me its pointless thanks to that I won#msg151145t fail after few months of trying.
 
Życzę wam seksu analnego po stronie biernej.
Dropbox +500 mb na start
LowPoly
Wykonanie modelu niskopoligonowego to sztuka kompromisu. Nie jest to jedynie uproszczenie modelu wysokopoligonowego, ale głęboka modyfikacja oraz podejmowanie decyzji często zmieniających wygląd pierwotny obiektu, tak by przy najmniejszej ilości trójkątów uzyskać jak najwierniej odwzorowany kształt oryginału. Nie można też zapomnieć o tym iż musi nadal wyglądać przekonywająco i tak balansować by uzyskać efekt optymalny.

Podstawowym założeniem jest, że model nie powinien mieć zbędnych, niewidocznych dla gracza detali włączonych w geometrie. Większość obiektów jakie znajdują się w grze powinna prezentować się najlepiej z odległości około 3-5 metrów. Wszelkie detale, które zanikają, wydają się płaskie lub zlewają się z bryłą modelu należy uznać za zbędne i pozostawić je na normal mapie.

Fakt, iż gracz będzie w stanie podejść bliżej do obiektu i zobaczyć go z mniejszej niż 3m odległości nie powinno stanowić większego problemu, gdyż większą rolę odgrywają wtedy tekstury oraz dodatkowy detal zależny od materiału obiektu. To właśnie kompromis między wydajnością, a szczegółowością otoczenia.

Detal, którego nie widać z 3-5 metrów nie powinnien istnieć w geometrii modelu.
Krawędzie znajdujące się blisko siebie, które zlewają się z większej odległości należy uprościć do wspólnej płaszczyzny

pawbuj

pawbuj

Użytkownicy
posty1625
Propsy135
ProfesjaSkrypter
  • Użytkownicy

pawbuj

Ikarus (Pakiet skryptów)
#159 2011-06-14, 00:04(Ostatnia zmiana: 2011-06-14, 00:07)
Lehona, can you describe a bit following function. it seems to be connected to insert a vob during a game. it is suitable for g1?

how to use it in practice?

what is var string vis?



/* Danke an Gottfried für die Entdeckung von Wld_InsertObject! */
func int MEM_InsertVob(var string vis, var string wp) {
    MEM_InitGlobalInst(); //MEM_World initialisieren
   
    /* oCMob von Gothic konstruieren lassen */
    Wld_InsertObject(vis,wp);
   
    /* Ein Pointer auf das neue Objekt findet sich im Vobtree
     * stets als erstes Kind des globalen Vobtrees */
    var zCTree newTreeNode;
    newTreeNode = MEM_PtrToInst (MEM_World.globalVobTree_firstChild);
    return newTreeNode.data;
};
 


0 użytkowników i 2 gości przegląda ten wątek.
0 użytkowników
Do góry