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 12 von 24 « Erste ... 589101112131415161923 ... Letzte »
Ergebnis 221 bis 240 von 468
  1. Beiträge anzeigen #221
    Local Hero Avatar von Mark56
    Registriert seit
    Sep 2010
    Beiträge
    254
     
    Mark56 ist offline
    If I understand you want to do damage to everybody on hero voblist ?
    Fucntion is for something entirely different...

  2. Beiträge anzeigen #222
    Dea
    Registriert seit
    Jul 2007
    Beiträge
    10.447
     
    Lehona ist offline
    Zitat Zitat von Mark56 Beitrag anzeigen
    I have to ask. When is this going to be "shipped" ?
    Looks very promising.
    Also that SAVE_GetFuncID(func f) caught my eye. I tried to use function IDs in same way (I had some instance "blueprints") but MEM_GetFuncID inside instance always caused Acces Violation.. Is this some workaround ?
    http://lego.worldofplayers.de/?Buffs
    Soon, I guess. I have exams currently, but maybe I can squeeze in an update. There's a couple of other scripts that will have to go along with it, mostly some convenience stuff, but maybe someone will find it helpful.

    Yes, that function is meant exactly to avoid errors in instances

    Daedalus works like this: Whenever there is something like instance.attribute (e.g. instance.attribute = 0), at first the "current instance" is set and then the class.member-offset is added to the address of that instance.
    Within instances (i.e. the "constructors"), you can leave out the "instance.", because the instance was set when the constructor was called. Accessing attributes of a different object will override the "current instance" and screw up everything! If you look at the implementation of SAVE_GetFuncID() it's rather easy and can be done for any function (it simply saves the current instance, does the call and restores it afterwards).
    To manually circumvent this, just explicitly state the instance once after a call, e.g.
    Code:
    instance inst (class) {
        MEM_GetFuncID(f);
        inst.name = "";
        // Continue as normal
    }
    Zitat Zitat von Siemekk Beitrag anzeigen
    Code:
    var c_npc oth; oth = _^(victimPtr);
    How i can assign to more than one NPC ?
    victimPtr=EBP.
    I do not know how I can explain this :/
    My Version Hero>Collect npc from hero voblist > Set damage
    As Mark56 said, that's not what that script is for. Instead it's useful to make your own damage calculations whenever a character is damaged "normally" (e.g. spells, melee hits, ...).


    Edit: Apparently I'm an idiot, because the Buffs-Script hasn't even been uploaded to the SVN yet, it's still only on my laptop. Well, I guess you'll have to look at it whenever I get around to a release
    Geändert von Lehona (07.08.2016 um 14:02 Uhr)

  3. Beiträge anzeigen #223
    Local Hero Avatar von Mark56
    Registriert seit
    Sep 2010
    Beiträge
    254
     
    Mark56 ist offline

    Just make a small commit. I have few weeks until semester starts again, and would like to finish some scripts.

  4. Beiträge anzeigen #224
    Dea
    Registriert seit
    Jul 2007
    Beiträge
    10.447
     
    Lehona ist offline
    Zitat Zitat von Mark56 Beitrag anzeigen

    Just make a small commit. I have few weeks until semester starts again, and would like to finish some scripts.
    Done. Talents.d and Buffs.d are nowhere near final, though, so don't be angry when something changes I'll try to keep the interface, but I can't guarantee anything.

  5. Beiträge anzeigen #225
    Waldläufer Avatar von Siemekk
    Registriert seit
    May 2016
    Beiträge
    121
     
    Siemekk ist offline
    Zitat Zitat von Mark56 Beitrag anzeigen
    If I understand you want to do damage to everybody on hero voblist ?
    Fucntion is for something entirely different...
    Thanks I wrote a new function. Result is satisfactory(for me)
    It is possible change vfx to zCVob ? In "Czas Zaplaty" collision is made from vfx (changed to zCVob ? )
    By this function:
    Code:
    func int I_zCTreeSearchVFX(var int ptr)
    {
    	if(ptr==0)
    	{
    	printdebug("ERROR!!!");
    	};
    	var string name;
    	name = "R_SWORDDAMAGE VOB";
    	
    	var int label; var int val; var int first_ptr; var int previous;
    	
    	first_ptr = ptr;
    	val = MEM_ReadInt(ptr+16);//data zCVobVFX?
    	if(val)
    	{
    		if(MEM_ReadInt(val)==8585884)&&(Hlp_StrCmp(MEM_ReadString(val+16),name))
    		{
    			return val;            
    		};
    	};
    	
    	MEM_InitLabels();
    	label = MEM_StackPos.position;  
    	if(previous)
    	{
    		ptr = MEM_ReadInt(ptr+12);//next               
    	}
    	else
    	{
    		ptr = MEM_ReadInt(ptr+8);//next
    	};
    	if(ptr==0)
    	{
    		previous=true;
    		ptr=first_ptr;
    		MEM_StackPos.position = label;
    	};
    	val = MEM_ReadInt(ptr+16);//data zCVobVFX?
    	if(val)
    	{
    		if(MEM_ReadInt(val)==8585884)&&(Hlp_StrCmp(MEM_ReadString(val+16),name))
    		{
    			return val;            
    		}
    		else if (first_ptr!=ptr)
    		{
    			MEM_StackPos.position = label;  
    		};
    	}
    	else 
    	{ 
    	return 0;
    	};
    	
    	
    };
    And my question : How change vfx to zCVob (i have an idea for Steaths, but i don't know how i can change vfx to zCVob :/)

  6. Beiträge anzeigen #226
    Ehrengarde Avatar von mud-freak
    Registriert seit
    Dec 2005
    Beiträge
    2.199
     
    mud-freak ist offline
    Zitat Zitat von Siemekk Beitrag anzeigen
    Thanks I wrote a new function. Result is satisfactory(for me)
    It is possible change vfx to zCVob ? In "Czas Zaplaty" collision is made from vfx (changed to zCVob ? )
    By this function:
    Code:
    func int I_zCTreeSearchVFX(var int ptr)
    {
    	if(ptr==0)
    	{
    	printdebug("ERROR!!!");
    	};
    	var string name;
    	name = "R_SWORDDAMAGE VOB";
    	
    	var int label; var int val; var int first_ptr; var int previous;
    	
    	first_ptr = ptr;
    	val = MEM_ReadInt(ptr+16);//data zCVobVFX?
    	if(val)
    	{
    		if(MEM_ReadInt(val)==8585884)&&(Hlp_StrCmp(MEM_ReadString(val+16),name))
    		{
    			return val;            
    		};
    	};
    	
    	MEM_InitLabels();
    	label = MEM_StackPos.position;  
    	if(previous)
    	{
    		ptr = MEM_ReadInt(ptr+12);//next               
    	}
    	else
    	{
    		ptr = MEM_ReadInt(ptr+8);//next
    	};
    	if(ptr==0)
    	{
    		previous=true;
    		ptr=first_ptr;
    		MEM_StackPos.position = label;
    	};
    	val = MEM_ReadInt(ptr+16);//data zCVobVFX?
    	if(val)
    	{
    		if(MEM_ReadInt(val)==8585884)&&(Hlp_StrCmp(MEM_ReadString(val+16),name))
    		{
    			return val;            
    		}
    		else if (first_ptr!=ptr)
    		{
    			MEM_StackPos.position = label;  
    		};
    	}
    	else 
    	{ 
    	return 0;
    	};
    	
    	
    };
    And my question : How change vfx to zCVob (i have an idea for Steaths, but i don't know how i can change vfx to zCVob :/)
    You actually don't need a zCVob to detect collision. In fact, you don't even need Ikarus for that. All you need to do is add collision detection to your VFX, like so:

    Code:
    INSTANCE yourVFX (CFx_Base_Proto)
    {
        // ...
        emActionCollDyn_S       = "CREATEONCE COLLIDE"; // Effect is removed when it collides ("CREATE COLLIDE" will keep it alive)
        emFXCollDyn_S           = "impactFX; // VFX instance for a visual effect on collision (optional)
        emFXCollDynPerc_S       = "triggerPerception"; // VFX instance to send perception
        emFXCollDynAlign_S      = "COLLISIONNORMAL";
        emCheckCollision        = 1; // If this is a spell, set this to 2, then it won't automatically deal damage
    }
    INSTANCE triggerPerception (CFx_Base_Proto)
    {
        sendAssessMagic         = 1; // This will call B_AssessMagic in which you can ask for the circumstances of the call and call other functions
    };
    You can add the respective CollStat options to also collide with static objects.
    If that does not work for you check out this engine function:
    Code:
    0x4968E0: virtual void __thiscall oCVisualFX::ReportCollision(zCCollisionReport const &)
    I find your script interesting. I take it, it is for finding a VFX instance? My question is, what pointer do I need to pass to the function. Is there a gloabal vfxTree pointer of the world like a zCVobTree for oCVisualFx?

  7. Beiträge anzeigen #227
    Local Hero Avatar von Mark56
    Registriert seit
    Sep 2010
    Beiträge
    254
     
    Mark56 ist offline
    @mud-freak I guess siemekk is mostly rewriting someone elses scripts.

    @Lehona Big thanks, there is little poroble though. I use LeGo on G1 which has most of the adressses ported. Most of them
    Do you remeber what this "9298296" magic nuber is, or where in the IDA should I look for it ? I get AV on ReadIntArray... I hope its only bad adress
    Spoiler:(zum lesen bitte Text markieren)
    Code:
    //========================================
    // Aktuelle Instanz bearbeiten
    //========================================
    func void MEM_SetUseInstance(var int inst) {
    	var int ptr; ptr = MEM_ReadIntArray (currSymbolTableAddress, inst);
    	MemoryProtectionOverride(9298296, 10);
    	MEM_WriteInt(9298296, ptr);
    	MEM_WriteInt(9298296, MEM_ReadInt(ptr+28));
    };
    
    func int MEM_GetUseInstance() {
    	return MEM_ReadInt(9298296);
    };


    Edit: Sorry, just checked and its already ported adress. My bad.
    Edit2: I looked into IDA and adresses seems to be correct. hmm any ideas ?

    Edit3: Okay. I made little workaround. Since I was not able to fix it.
    Here is code, if anybody with Gothic 1 has the same problem. (Based on ikarus function)
    Spoiler:(zum lesen bitte Text markieren)
    Code:
    func int MEM_StringToFuncID(var string fnc) {
    	if (Hlp_StrCmp (fnc, "")) {
            MEM_Error ("MEM_CallByString: fnc may not be an empty string!");
            return -1;
        };
    	
    	/* Mikrooptimierung: Wird zweimal hintereinander die selbe Funktion
         * mit CallByString aufgerufen, nicht nochmal neu suchen. */
    	var int symbID;
        var string cacheFunc; var int cacheSymbID;
    
        if (Hlp_StrCmp (cacheFunc, fnc)) {
            symbID = cacheSymbID;
        } else {
            symbID = MEM_FindParserSymbol (fnc);
    
            if (symbID == -1) {
                MEM_Error (ConcatStrings ("MEM_CallByString: Undefined symbol: ", fnc));
                return -1;
            };
    
            cacheFunc = fnc; cacheSymbID = symbID;
        };
    
        return symbID;
    };
    usable in instances like this
    Code:
    instance inst_name(...) {
    	a = 2l;//
    	on_click = MEM_StringToFuncID("fooo");
    }
    Geändert von Mark56 (10.08.2016 um 12:35 Uhr)

  8. Beiträge anzeigen #228
    Dea
    Registriert seit
    Jul 2007
    Beiträge
    10.447
     
    Lehona ist offline
    Zitat Zitat von Mark56 Beitrag anzeigen
    [...]
    That's because your version of MEM_SetUseInstance() is old. Use this one:
    Code:
    func void MEM_SetUseInstance(var int ptr) {
    	MemoryProtectionOverride(9298296, 10);
    	MEM_WriteInt(9298296, ptr);
    	MEM_WriteInt(9298296, MEM_ReadInt(ptr+28));
    };
    The address can stay the same, it's just expecting a zCPar_Symbol* instead of a symbol ID now (makes more sense, because MEM_GetUseInstance() returns a zCPar_Symbol*).

  9. Beiträge anzeigen #229
    Dea
    Registriert seit
    Jul 2007
    Beiträge
    10.447
     
    Lehona ist offline
    LeGo 2.3.5



    Talents.d

    Das Script wurde schonmal im Forum gepostet, es erlaubt einem zwei Dinge zu tun:

    • Jeder NPC kann durch eine eindeutige, dauerhafte ID identifiziert (und gefunden) werden
    • Man kann eine beliebige Menge an Daten für jeden NPC speichern


    ItemHelper.d
    Dieses Script ist relativ langweilig, es erlaubt einem für eine beliebige C_Item (oder oCItem) Instanz einen gültigen Pointer zu bekommen.

    Die Dokumentation im Wiki erfolgt in den nächsten Tagen.

    English:
    Spoiler:(zum lesen bitte Text markieren)
    Talents.d

    This script has been posted in this forum before, it enables you to do two things:

    • Get a unique, persistent identifier for any Npc and "find" the associated Npc for a given ID
    • Easily save an unlimited amount of data per NPC


    ItemHelper.d
    This script is rather mundane, you get a valid pointer for any given instance of C_Item (or oCItem). Probably only useful in fringe cases (e.g. rendering items on the screen).

    I will update the wiki in the next few days.

  10. Beiträge anzeigen #230
    Apprentice Avatar von Rayzer
    Registriert seit
    Sep 2014
    Ort
    Poland
    Beiträge
    44
     
    Rayzer ist offline
    Did you check this version? Variable Talent_Names isn't declared and nowhere is used, expect line 194 in LeGo.d.

  11. Beiträge anzeigen #231
    Dea
    Registriert seit
    Jul 2007
    Beiträge
    10.447
     
    Lehona ist offline
    I did, but apparently an old file snuck into the release? It seems to be just a typo (Talent_Name would've been right), which was literally the last fix/change I made before I (succesfully) started testing.

    I'll have a deeper look into it tomorrow, so there'll be no other surprises.

  12. Beiträge anzeigen #232
    now also in your universe  Avatar von Milky-Way
    Registriert seit
    Jun 2007
    Beiträge
    15.244
     
    Milky-Way ist offline
    In Version 2.3.5 gibt es, glaube ich, noch einen kleinen Fehler.

    LeGo.d Zeile 194:
    Code:
    Talent_Names = TAL_CreateTalent();
    Names.d Zeile 4:
    Code:
    var int Talent_Name;

    Talent_Names scheint es bei mir sonst nicht zu geben. Also einfach das s in Zeile 194 entfernen, oder habe ich was falsch gemacht?

  13. Beiträge anzeigen #233
    Dea
    Registriert seit
    Jul 2007
    Beiträge
    10.447
     
    Lehona ist offline
    Das ist genau, worauf Rayzer sich in Post #230 bezieht.
    Ich habe noch keine neue Version hochgeladen, weil ich sichergehen wollte, dass sich nicht noch irgendwo anders alte Dateien eingeschlichen haben und weil ich mich (immernoch! ) in meinen Prüfungsvorbereitungen verloren habe.

  14. Beiträge anzeigen #234
    now also in your universe  Avatar von Milky-Way
    Registriert seit
    Jun 2007
    Beiträge
    15.244
     
    Milky-Way ist offline
    Zitat Zitat von Lehona Beitrag anzeigen
    Das ist genau, worauf Rayzer sich in Post #230 bezieht.
    Ich habe noch keine neue Version hochgeladen, weil ich sichergehen wollte, dass sich nicht noch irgendwo anders alte Dateien eingeschlichen haben und weil ich mich (immernoch! ) in meinen Prüfungsvorbereitungen verloren habe.
    Stimmt, da war ich etwas blind. Es ist ja zum Glück ein Fehler, den wohl jeder auch selbst beheben kann.

  15. Beiträge anzeigen #235
    Waldläufer Avatar von Siemekk
    Registriert seit
    May 2016
    Beiträge
    121
     
    Siemekk ist offline
    Hello another time
    I use Cursor && Buttons to my new Menu. But when i'm in the city, cursor was very slow. How I can change DPI in game ? Because this is not good effect

  16. Beiträge anzeigen #236
    Ehrengarde Avatar von mud-freak
    Registriert seit
    Dec 2005
    Beiträge
    2.199
     
    mud-freak ist offline
    Zitat Zitat von Siemekk Beitrag anzeigen
    Hello another time
    I use Cursor && Buttons to my new Menu. But when i'm in the city, cursor was very slow. How I can change DPI in game ? Because this is not good effect
    I actually had the same problem designing free aiming. There is no frame-lock on the cursor.
    Here is what I did. (mouseDeltaX and mouseSensX are pointers to x movement and x sensitivity, respectively)

    Code:
    var int deltaX; deltaX = mulf(mkf(MEM_ReadInt(mouseDeltaX)), MEM_ReadInt(mouseSensX)); // Get mouse change in x
    var int frameAdj; frameAdj = mulf(MEM_Timer.frameTimeFloat, fracf(16, 1000)); // Frame "lock"
    deltaX = mulf(deltaX, frameAdj);
    The 0.016 is approximate. I went through a long process of testing the mouse movement with different fps. 0.016 is the slope of the linear(!) regression line of the recorded mouse movements. Since gothic is not a serious shooter, I was satisfied with the level of consistency achieved by that multiplier. For a cursor this approximate solution should be even less of a problem.

    Something like this should fix the problem (not tested) and could be implemented in the next LeGo update:

    Cursor.d
    Code:
    func void _Cursor_GetVal() {
        var _Cursor c; c = _^(Cursor_Ptr);
    
        Cursor_RelX = c.relX;
        Cursor_RelY = c.relY;
        Cursor_fX = addf(mulf(mkf(Cursor_RelX), mulf(MEM_ReadInt(Cursor_sX), mkf(2))), Cursor_fX);
        Cursor_fY = addf(mulf(mkf(Cursor_RelY), mulf(MEM_ReadInt(Cursor_sY), mkf(2))), Cursor_fY);
        var int deltaX; deltaX = mulf(mkf(Cursor_RelX), mulf(MEM_ReadInt(Cursor_sX), mkf(2)));
        var int deltaY; deltaY = mulf(mkf(Cursor_RelY), mulf(MEM_ReadInt(Cursor_sY), mkf(2)));
    
        var int frameAdj; frameAdj = mulf(MEM_Timer.frameTimeFloat, fracf(16, 1000)); // Frame lock
        Cursor_fX = addf(mulf(deltaX, frameAdj), Cursor_fX);
        Cursor_fY = addf(mulf(deltaY, frameAdj), Cursor_fY);
    
        Cursor_X = roundf(Cursor_fX);
        Cursor_Y = roundf(Cursor_fY);
        Cursor_Wheel = c.wheel;
    
        //...
    };
    Geändert von mud-freak (21.08.2016 um 13:56 Uhr)

  17. Beiträge anzeigen #237
    Waldläufer Avatar von Siemekk
    Registriert seit
    May 2016
    Beiträge
    121
     
    Siemekk ist offline
    So... The cursor moving only when is hidden.

  18. Beiträge anzeigen #238
    Ehrengarde Avatar von mud-freak
    Registriert seit
    Dec 2005
    Beiträge
    2.199
     
    mud-freak ist offline
    Zitat Zitat von Siemekk Beitrag anzeigen
    So... The cursor moving only when is hidden.
    I don't understand. Is that a question, or is that happening in your mod? Could you explain what exactly you mean?

  19. Beiträge anzeigen #239
    Waldläufer Avatar von Siemekk
    Registriert seit
    May 2016
    Beiträge
    121
     
    Siemekk ist offline
    Cursor was not moving : / When I hide cursor and renew the show , then cursor is in a new position .

  20. Beiträge anzeigen #240
    Dea
    Registriert seit
    Jul 2007
    Beiträge
    10.447
     
    Lehona ist offline
    Can you show us your code?
    Also, did you make sure the mouse is enabled? You can do it from the scripts via
    Code:
    SetMouseEnabled(true)

Seite 12 von 24 « Erste ... 589101112131415161923 ... 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