Portal-Zone Gothic-Zone Gothic II-Zone Gothic 3-Zone Gothic 4-Zone Modifikationen-Zone Download-Zone Foren-Zone RPG-Zone Almanach-Zone Spirit of Gothic

 

Seite 5 von 24 « Erste 1234567891216 ... Letzte »
Ergebnis 81 bis 100 von 468
  1. Beiträge anzeigen #81
    Legend of Ahssûn Avatar von TheEternal
    Registriert seit
    Jun 2013
    Ort
    Frankfurt
    Beiträge
    4.546
     
    TheEternal ist offline
    Zitat Zitat von Rayzer Beitrag anzeigen
    I'm trying to call a function by hooking hero melee weapon attacks, but my problem is that the function is calling several times during one a single attack.
    Code:
    HookEngineF (7668064, 6, HeroAttack); //left
    HookEngineF (7671040, 7, HeroAttack); //right
    HookEngineF (7673808, 7, HeroAttack); //forward attack
    HookEngineF (7664640, 6, HeroAttack); //combo
    Is this possible to call function only once per attack?
    I had the same problem. you could use a variable to only perform your desired action once when the attack is performed:


    Code:
    var int attackonce;
    if attackright  && attackonce == FALSE{
      //your desired action
      attackright = FALSE;
      attackonce = TRUE;
    }
    [Bild: LoA_Banner_Skyline2.jpg]
    LoA Website
    Checkout Cloudevo: unlimited Cloud-Drive

    Geändert von TheEternal (30.06.2015 um 15:14 Uhr) Grund: //

  2. Beiträge anzeigen #82
    Local Hero Avatar von Mark56
    Registriert seit
    Sep 2010
    Beiträge
    254
     
    Mark56 ist offline
    Hello. I created queue which uses list to store handles to my new class items . But unfortunately it crashes sometimes when loading. Especialy when list is populated (loading save, which was done at time when list stored some handles ) with handles. I guess my function tries to use those handles but my class objects are not archived, so upon loading those handles refer to nothing and that causes crash. Do I need to create some kind of archiver as other lego classes have ? If yes, could you explain me how to do it ?
    Mfg Mark

  3. Beiträge anzeigen #83
    Dea
    Registriert seit
    Jul 2007
    Beiträge
    10.447
     
    Lehona ist offline
    I can't say anything until you show me your code.

  4. Beiträge anzeigen #84
    Local Hero Avatar von Mark56
    Registriert seit
    Sep 2010
    Beiträge
    254
     
    Mark56 ist offline
    Looks like I sorted it out. I had to destory list in Init_global, in case it was not empty. More or less fixed...

  5. Beiträge anzeigen #85
    Local Hero
    Registriert seit
    Feb 2013
    Beiträge
    236
     
    pawbuj ist offline

    bars

    Hi, anyone knows how to make 2-colored bar in Gothic 1 or 2?

    I am making 2 bars on 1 surface, but the second bar is partially covered due to low transparency of first standard HP Bar.

  6. Beiträge anzeigen #86
    now also in your universe  Avatar von Milky-Way
    Registriert seit
    Jun 2007
    Beiträge
    15.244
     
    Milky-Way ist offline
    What exactly do you want it to look like?

  7. Beiträge anzeigen #87
    Local Hero Avatar von Mark56
    Registriert seit
    Sep 2010
    Beiträge
    254
     
    Mark56 ist offline
    Hello. I still have problem with those lists. So its notification system based on list. Notifications are added to the list and then one after another gets rendered and removed.
    List is most of the time empty. Problem occurs when I save the game with list containing more nodes. Game crashes trying to use data from the list ( I guss ). I looked in the scriptsave.sav and the list is stored in there with the data (handles to NMsg ), but the handles itself are not in the file.
    I really want to be able to save/load list and objects it stores handles to. Hope anyone can help me.
    Code:
    var int NMsg_List; // zCList
    var int NMsg_Active; // 
    class NMsg
    {
    	var int type;
    	var string text1;
    	var string text2;
    	var string sound;
    };
    
    instance NMsg@(NMsg);
    
    func int List_CreateH(var int data) // create list return handle
    {
    	var int hndl;
    	hndl = new (zCList@);
    	// var zCList l; l = _^(getPtr(hndl));
    	var zCList l; l = get(hndl); 
    	l.data = data;
    	l.next = 0;
    	return hndl;
    };
    
    func void Notify_Init() // init_global
    {
    	if (!(getPtr(NMsg_List))) 
    	{
    		NMsg_List = List_CreateH(0);
    	};
    };
    
    func void NMsg_Create(var string text1,var string text2,var int Ntf_type,var string snd)
    {
    
    	if (!(getPtr(NMsg_List))) 
    	{
    		NMsg_List = List_CreateH(0);
    	};
    	PrintDebug("Notify: List_Add");
    	var int hndl; hndl = new(NMsg@);
    	var NMsg msg; msg = get(hndl);
    	msg.text1 = text1;
    	msg.text2 = text2;
    	msg.type = Ntf_type;
    	msg.sound = snd;
    	List_Add(getPtr(NMsg_List),hndl);
    };
    
    func void NMsg_Remove(var int hndl) // msg handle
    {
    	if (!Hlp_IsValidHandle(hndl))
    	{
    		return;
    	}; 
    	PrintDebug("Notify: List_Remove");
    	List_Delete(getPtr(NMsg_List), List_Contains(getPtr(NMsg_List), hndl)); // remove from list
    	if (Hlp_IsValidHandle(hndl))
    	{
    		delete(hndl); // delete handle
    	}; 
    };
    
    func void NMsg_Show(var string txt1,var string font1,var string txt2,var string font2,var string sound)
    {
    NMsg_Active = true;
    // stuff
    NMsg_Active = false; // after short delay
    };
    
    func void Notify_func() // looped by ff fucntion
    {
    	if(!Hlp_IsValidNpc(hero)) { return; };
    	if ((MEM_Game.pause_screen)) /*|| (!InfoManager_HasFinished()))*/ { return; };
    	if (!NMsg_List) 		{ return; };
    	if (!getPtr(NMsg_List)) { return; };
    	if (NMsg_Active) 		{ return; };
    	
    	var zCList l; l = get(NMsg_List);
    	var NMsg msg;
    	
    	if (l.next)
    	{
    		var int hndl; 
    		hndl = List_Get(getPtr(NMsg_List),2);
    		msg = get(hndl);
    		NMsg_Show(msg.text1,NMsg_FontSmall,msg.text2,NMsg_FontSmall,msg.sound);
    		NMsg_Remove(h);
    	};
    };

  8. Beiträge anzeigen #88
    Dea
    Registriert seit
    Jul 2007
    Beiträge
    10.447
     
    Lehona ist offline
    Uh, that looks correct. Everything created with new() should automatically land in the savefile - are you sure there's nothing in there?
    If it crashes upon saving, that will most likely be the cause, although I don't see any reason why that would happen. What error messages are you getting?

  9. Beiträge anzeigen #89
    now also in your universe  Avatar von Milky-Way
    Registriert seit
    Jun 2007
    Beiträge
    15.244
     
    Milky-Way ist offline
    Kurze Frage:

    Ich starte Gothic.
    Ich starte ein neues Spiel und hooke eine Funktion.
    Ich speichere das Spiel.
    Ich beende Gothic.
    Ich starte Gothic.
    Ich lade den Spielstand (hooke die Funktion aber nicht wieder neu).

    Kann der Hook noch irgendwie aktiv sein?

  10. Beiträge anzeigen #90
    Dea
    Registriert seit
    Jul 2007
    Beiträge
    10.447
     
    Lehona ist offline
    Nein. Beim Starten von Gothic wird die Gothic2.exe von der Festplatte in den Speicher geladen, ohne die Änderungen von HookEngine (die nie gespeichert werden).

  11. Beiträge anzeigen #91
    Local Hero Avatar von Mark56
    Registriert seit
    Sep 2010
    Beiträge
    254
     
    Mark56 ist offline
    Hello, I am thinking about using your button packet and I have one question.
    Code:
    if (Cursor_Left==KEY_PRESSED) {
    	MEM_PushIntParam(MEM_ReadStatArr(_Buttons, i));
    	MEM_CallByID(btn.on_click);
    };
    This is from function Buttons_Do in packet source. Does that PushIntParam mean that I can make function like bellow, and the button hadle is actually passed as parameter ?
    Code:
    func void Button_clickevent(var int hndl) {
     // do stuff
    };

  12. Beiträge anzeigen #92
    Local Hero
    Registriert seit
    Feb 2013
    Beiträge
    236
     
    pawbuj ist offline

    COLOR OF LOG MENU

    hi, here is the script to change color of text in missions menu. It looks great till I skipped to another kind of log . (for example from missions running to missions failed)

    Code:
     Func void _ChangeFontColorLogItem()
     {
    ChangeFontColorMenuItem("MENU_ITEM_SEL_MISSIONS_OLD", RGBA(0,255,255,255));      
    ChangeFontColorMenuItem("MENU_ITEM_SEL_MISSIONS_ACT", RGBA(210,255,128,255));
    
    func void ChangeFontColorMenuItem(var string menuItemName, var int color) {
        var int menuIptr; menuIptr = MEM_GetMenuItemByString(menuItemName);
        var int col; col = color;
        if (menuIptr) {
            var zCMenuItem menuI; menuI = _^(menuIptr);
    
            if (menuI.m_pInnerWindow) {
                var zCView viewI; viewI = _^(menuI.m_pInnerWindow);
    
                if (viewI.textLines_next) {
                    var zCList listI; listI = _^(viewI.textLines_next);
    
                    if (listI.data) {
                        var zCViewText viewTI; viewTI  = _^(listI.data);
    
                        MEM_WriteInt(_@(viewTI.color), col); 
                        viewTI.colored = 1;
                    };
                };
            };
        };
    };

  13. Beiträge anzeigen #93
    Dea
    Registriert seit
    Jul 2007
    Beiträge
    10.447
     
    Lehona ist offline
    Zitat Zitat von Mark56 Beitrag anzeigen
    Hello, I am thinking about using your button packet and I have one question.
    Code:
    if (Cursor_Left==KEY_PRESSED) {
    	MEM_PushIntParam(MEM_ReadStatArr(_Buttons, i));
    	MEM_CallByID(btn.on_click);
    };
    This is from function Buttons_Do in packet source. Does that PushIntParam mean that I can make function like bellow, and the button hadle is actually passed as parameter ?
    Code:
    func void Button_clickevent(var int hndl) {
     // do stuff
    };
    Yes exactly, I should've mentioned it in the wiki.

  14. Beiträge anzeigen #94
    Legend of Ahssûn Avatar von TheEternal
    Registriert seit
    Jun 2013
    Ort
    Frankfurt
    Beiträge
    4.546
     
    TheEternal ist offline
    ich möchte mit einem Hook das Dropevent abfangen und dabei wissen, welches Item gedroppt wird.
    Um auf ein spezielles Item reagieren zu können.

    Hook funktioniert auch soweit an der Funktion
    Code:
    virtual int __thiscall oCNpc::DoDropVob(zCVob *)
    Code:
    func void HOOK_AI_Drop(){
            PrintDebugg("HERO AI_Drop happened");
            AMBVAR_DROPWP = Npc_GetNearestWP(hero);
            Mdl_ApplyOverlayMdsTimed (Npc, "HUMANS_SPRINT.MDS", SPL_Duration_SPEED);
            NewRout(Npc, "pickup");
    };
    
    
    HookEngineF ( 7622096, 6, HOOK_AI_Drop); // Hook AIDrop (/*0x00744DD0*/)
    Kann mir einer helfen, wie ich da an das zCVob komme und das gegen etwas anderes vergleichen kann?
    zB gegen ItMi_OldCoin oder ItMi_OldCoin.3ds
    [Bild: LoA_Banner_Skyline2.jpg]
    LoA Website
    Checkout Cloudevo: unlimited Cloud-Drive


  15. Beiträge anzeigen #95
    now also in your universe  Avatar von Milky-Way
    Registriert seit
    Jun 2007
    Beiträge
    15.244
     
    Milky-Way ist offline
    Schau mal hier:
    http://forum.worldofplayers.de/forum...1#post16744409

    Ich könnte mir vorstellen, dass NPC und Item an gleicher (relativer) Stelle zu finden sind.

    Und dann gibt es aus der Externals.d
    Code:
    FUNC INT 	Hlp_IsItem 				(VAR C_Item item, VAR INT instanceName)
    // Prüft, ob der Gegenstand 'item' den Instanznamen 'instanceName' trägt. Will man z.B. testen,
    // ob die globale Variable item Pfeile sind (ItMuArrow) ruft man Hlp_IsItem(item,ItMuArrow) auf.
    // Gribt bei Gleichheit TRUE, sonst FALSE zurück.
    Geändert von Milky-Way (12.09.2015 um 17:15 Uhr)

  16. Beiträge anzeigen #96
    Legend of Ahssûn Avatar von TheEternal
    Registriert seit
    Jun 2013
    Ort
    Frankfurt
    Beiträge
    4.546
     
    TheEternal ist offline
    Jo, danke Milky-Way. Konnte es damit lösen.
    [Bild: LoA_Banner_Skyline2.jpg]
    LoA Website
    Checkout Cloudevo: unlimited Cloud-Drive


  17. Beiträge anzeigen #97
    Ranger Avatar von Abuyin Sharidi
    Registriert seit
    Mar 2014
    Beiträge
    159
     
    Abuyin Sharidi ist offline

    blume

    Bug report (not sure if it is a bug or not, to be honest):

    FF_ApplyOnceExt(func, 1, -1); drops FPS. In Khorinis I had 22 - 25 FPS without any function, with two with the second parameter set to 1, I have 9 - 11 FPS.

    Greetings!

  18. Beiträge anzeigen #98
    Veteran
    Registriert seit
    Jan 2012
    Beiträge
    681
     
    Frank-95 ist offline
    Try to give more information about the problem, so that lehona or someone else could find a solution for a possible bug, or can just tell you what's going on.

    Does it happen with different time steps too? Post here the called function, it will help.

  19. Beiträge anzeigen #99
    Ranger Avatar von Abuyin Sharidi
    Registriert seit
    Mar 2014
    Beiträge
    159
     
    Abuyin Sharidi ist offline

    blume

    Those are all informations. FPS' just drop when setting it to apply 1000 times a second, only.

  20. Beiträge anzeigen #100
    Dea
    Registriert seit
    Jul 2007
    Beiträge
    10.447
     
    Lehona ist offline
    LeGo (tries to) guarantee that it will be called 1000x per second, even if that means calling it multiple times per frame. If you average around 25 FPS, that means 40ms/frame. So LeGo will call the function 40x per frame.

    Never use small ms values unless you have a very specific reason to do so (I can't think of any). 0 will guarantee it's called exactly once per frame.

Seite 5 von 24 « Erste 1234567891216 ... Letzte »

Berechtigungen

  • Neue Themen erstellen: Nein
  • Themen beantworten: Nein
  • Anhänge hochladen: Nein
  • Beiträge bearbeiten: Nein
Impressum | Link Us | intern
World of Gothic © by World of Gothic Team
Gothic, Gothic 2 & Gothic 3 are © by Piranha Bytes & Egmont Interactive & JoWooD Productions AG, all rights reserved worldwide