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 2 von 6 « Erste 123456 Letzte »
Ergebnis 21 bis 40 von 117
  1. Beiträge anzeigen #21 Zitieren
    Dea
    Registriert seit
    Jul 2007
    Beiträge
    10.446
     
    Lehona ist offline
    Zitat Zitat von Teron Gorefiend Beitrag anzeigen
    verdammt ich wollte auch gerne die Schadensberechnung (die wirklich 1a ist) auf G1 anwenden. Aber Ikarus 1.2 gibt es bisher ja nur für G2. Gibts da ne Möglichkeit was zu machen?
    LeGo funktioniert nicht mit Gothic 1, allerdings gibt es eine Version der HookEngine.d für Gothic 1. Aber du müsstest eh die Adresse anpassen und ich habe momentan keine Gothic1-Executable.

  2. Beiträge anzeigen #22 Zitieren
    Held Avatar von Teron Gorefiend
    Registriert seit
    Nov 2006
    Ort
    im Alchemielabor
    Beiträge
    5.116
     
    Teron Gorefiend ist offline
    Zitat Zitat von Lehona Beitrag anzeigen
    LeGo funktioniert nicht mit Gothic 1, allerdings gibt es eine Version der HookEngine.d für Gothic 1. Aber du müsstest eh die Adresse anpassen und ich habe momentan keine Gothic1-Executable.
    Schade G1 könnte dringend eine neue Schadensberechnung gebrauchen. Wenn sich da was ändern sollte sag mir bitte bescheid.

    wird dann auch nur ne kleine minimod, neue schadensberechnung mit bogenspannzeit bonus und fertig.

    Edit: Verdammt aber dann kann ich ja auch keine bar machen. die das Spannlevel beim Bogen anzeigt.
    Geändert von Teron Gorefiend (28.06.2012 um 23:04 Uhr)

  3. Beiträge anzeigen #23 Zitieren
    Dea
    Registriert seit
    Jul 2007
    Beiträge
    10.446
     
    Lehona ist offline
    Mit LeGo 2.2.2 entfällt nun das aktualisieren der HookEngine.d

  4. Beiträge anzeigen #24 Zitieren
    Serima Avatar von Fisk2033
    Registriert seit
    Dec 2010
    Ort
    Dresden
    Beiträge
    5.802
     
    Fisk2033 ist offline
    Zitat Zitat von Lehona Beitrag anzeigen
    Um auf die NPCs zuzugreifen:
    Code:
    var c_npc slf; slf = _^(attackerptr);
    var c_npc oth; oth = _^(victimPtr);
    Hi, was bedeutet eig.:"_^"?

  5. Beiträge anzeigen #25 Zitieren
    Dea
    Registriert seit
    Jul 2007
    Beiträge
    10.446
     
    Lehona ist offline
    Zitat Zitat von Fisk2033 Beitrag anzeigen
    Hi, was bedeutet eig.:"_^"?
    Das ist (seit Ikarus 1.2a) ein Kürzel für MEM_PtrToInst(). Da man das relativ oft braucht, es aber viel zu lang ist, um es jedesmal auszuschreiben, hat Sekti ein paar Kürzel eingeführt (z.B. auch _@()).

  6. Beiträge anzeigen #26 Zitieren
    Veteran
    Registriert seit
    Jan 2012
    Beiträge
    681
     
    Frank-95 ist offline
    Hi

    How can you manage the damage output of spells?

    I need to double the damage of certain spells but only if they're scrolls:

    Code:
    func int DMG_OnDmg(var int victimPtr, var int attackerPtr, var int dmg)
    { 
        
        var c_npc slf; slf = _^(attackerptr);
        var c_npc oth; oth = _^(victimPtr);
        
        if(Npc_GetActiveSpellIsScroll(slf))
        {
            if(Npc_GetLastHitSpellID(oth) == SPL_XXX)
            {
                return dmg * 2;
            };
        };
        
        return dmg;
    };
    Or

    Code:
        if(Npc_GetActiveSpellIsScroll(slf))
        {
            if(Npc_GetActiveSpell(slf) == SPL_XXX)
            {
                return dmg * 2;
            };
        };
    I tried this last code for first, but I suppose that it did not work because after casting the spell you don't have the scroll active anymore (if you have only one scroll per spell).
    On the other hand the first code didn't work either, probably because of the same reason: if I have one scroll, I cast it, Npc_GetActiveSpellIsScroll(slf) returns false because I don't have the scroll anymore, right?
    It depends on when this function is called by the engine.

  7. Beiträge anzeigen #27 Zitieren
    Dea
    Registriert seit
    Jul 2007
    Beiträge
    10.446
     
    Lehona ist offline
    What you're asking for is surprisingly hard, because, as you might have guessed, this script is called exactly when any damage is dealt - in the case of a projectile it will be called upon impact.
    First of all, I'd like you to check out ~\Scripts\Content\AI\Magic\C_CanNpcCollideWithSpell.d, this script already offers you the ability to double the damage in some cases. However, I don't know whether checking for a scroll will work in this case and I'm pretty sure you can't do anything else besides doubling or halving the damage.

    Another approach would be to simply create a new spell that deals double damage, but if you want this for every scroll, that will probably be impossible (I think you can have only 100 spells in G2A).

    If you're willing to use a system that can be (somewhat easily) exploited, you could periodically check what magic the player currently has drawn. Obviously drawing another spell while the projectile is mid-air will exploit this. Do you draw a different spell, if you run out of scrolls? I'm not entirely sure.

    I don't really see an easy solution to this. I've always wondered whether "hooking an animation" works (you can create items in the mds - technically you could use this to execute code in the instance function?), this might be another way to solve this.

    A third way would require your own projectile system which just might be slightly overboard.

  8. Beiträge anzeigen #28 Zitieren
    Veteran
    Registriert seit
    Jan 2012
    Beiträge
    681
     
    Frank-95 ist offline
    Wow, I imagined that it could have been hard, not so much, though.

    Anyway, I decided to try to implement this because my previous try went wrong.

    As you know charge spells have the same mana cost of the runes, making them quite useless for every class (since paladins and dragon hunters don't have so much mana).
    I first tried to edit the spell_xxx_logic function using different mana cost in case it's a spell:

    Code:
    func int Spell_Logic_ChargeZap(var int manaInvested)
    {
        if(!Npc_GetActiveSpellIsScroll(self))
        {
            if(self.attribute[ATR_MANA] < STEP_ChargeZap)
            {
                return SPL_DONTINVEST;
            };
            if(manaInvested <= (STEP_ChargeZap * 1))
            {
                self.aivar[AIV_SpellLevel] = 1;
                return SPL_STATUS_CANINVEST_NO_MANADEC;
            }
            else if((manaInvested > (STEP_ChargeZap * 1)) && (self.aivar[AIV_SpellLevel] <= 1))
            {
                self.attribute[ATR_MANA] = self.attribute[ATR_MANA] - STEP_ChargeZap;
                if(self.attribute[ATR_MANA] < 0)
                {
                    self.attribute[ATR_MANA] = 0;
                };
                self.aivar[AIV_SpellLevel] = 2;
                return SPL_NEXTLEVEL;
            }
            else if((manaInvested > (STEP_ChargeZap * 2)) && (self.aivar[AIV_SpellLevel] <= 2))
            {
                self.attribute[ATR_MANA] = self.attribute[ATR_MANA] - STEP_ChargeZap;
                if(self.attribute[ATR_MANA] < 0)
                {
                    self.attribute[ATR_MANA] = 0;
                };
                self.aivar[AIV_SpellLevel] = 3;
                return SPL_NEXTLEVEL;
            }
            else if((manaInvested > (STEP_ChargeZap * 3)) && (self.aivar[AIV_SpellLevel] <= 3))
            {
                self.attribute[ATR_MANA] = self.attribute[ATR_MANA] - STEP_ChargeZap;
                if(self.attribute[ATR_MANA] < 0)
                {
                    self.attribute[ATR_MANA] = 0;
                };
                self.aivar[AIV_SpellLevel] = 4;
                return SPL_NEXTLEVEL;
            }
            else if((manaInvested > (STEP_ChargeZap * 3)) && (self.aivar[AIV_SpellLevel] == 4))
            {
                return SPL_DONTINVEST;
            };
            return SPL_STATUS_CANINVEST_NO_MANADEC;
        }
        else
        {
            if(self.attribute[ATR_MANA] < STEP_ChargeZap_Scroll)
            {
                return SPL_DONTINVEST;
            };
            if(manaInvested <= (STEP_ChargeZap_Scroll * 1))
            {
                self.aivar[AIV_SpellLevel] = 1;
                return SPL_STATUS_CANINVEST_NO_MANADEC;
            }
            else if((manaInvested > (STEP_ChargeZap_Scroll * 1)) && (self.aivar[AIV_SpellLevel] <= 1))
            {
                self.attribute[ATR_MANA] = self.attribute[ATR_MANA] - STEP_ChargeZap_Scroll;
                if(self.attribute[ATR_MANA] < 0)
                {
                    self.attribute[ATR_MANA] = 0;
                };
                self.aivar[AIV_SpellLevel] = 2;
                return SPL_NEXTLEVEL;
            }
            else if((manaInvested > (STEP_ChargeZap_Scroll * 2)) && (self.aivar[AIV_SpellLevel] <= 2))
            {
                self.attribute[ATR_MANA] = self.attribute[ATR_MANA] - STEP_ChargeZap_Scroll;
                if(self.attribute[ATR_MANA] < 0)
                {
                    self.attribute[ATR_MANA] = 0;
                };
                self.aivar[AIV_SpellLevel] = 3;
                return SPL_NEXTLEVEL;
            }
            else if((manaInvested > (STEP_ChargeZap_Scroll * 3)) && (self.aivar[AIV_SpellLevel] <= 3))
            {
                self.attribute[ATR_MANA] = self.attribute[ATR_MANA] - STEP_ChargeZap_Scroll;
                if(self.attribute[ATR_MANA] < 0)
                {
                    self.attribute[ATR_MANA] = 0;
                };
                self.aivar[AIV_SpellLevel] = 4;
                return SPL_NEXTLEVEL;
            }
            else if((manaInvested > (STEP_ChargeZap_Scroll * 3)) && (self.aivar[AIV_SpellLevel] == 4))
            {
                return SPL_DONTINVEST;
            };
            return SPL_STATUS_CANINVEST_NO_MANADEC;
        };
    };
    The result was that, I don't know why, the spell charged instantly but it output the minum damage. So I thought that the amount of mana needed was hardcoded.

    So I decided to make that spell instant (only for scrolls). And it worked but the damage is unbalanced.

    I don't think that there is an easy way to bypass this problem, so I would like you to confirm whether the easiest choice for me would be to create new spells. Thanks.

  9. Beiträge anzeigen #29 Zitieren
    Ritter Avatar von Diego93
    Registriert seit
    Dec 2008
    Ort
    Ortenau, Baden
    Beiträge
    1.412
     
    Diego93 ist offline
    I might be wrong but are sure that scrolls don't use 10 mana, no matter what spell it is?

  10. Beiträge anzeigen #30 Zitieren
    Veteran
    Registriert seit
    Jan 2012
    Beiträge
    681
     
    Frank-95 ist offline
    No charge spellls scrolls require the same mana of the runes

  11. Beiträge anzeigen #31 Zitieren
    Ranger Avatar von Demondays
    Registriert seit
    Feb 2015
    Beiträge
    173
     
    Demondays ist offline
    Is the damage setted in this function still taking into consideration target armor or is it final? I mean for example, if I set it to do 100 magic damage and my target will have 50 magic defense, it will ignore my victim defense and deal 100 damage or only 50? Also what with minimal damage gothic uses? With this function Gothic ignores it or it will still apply min damage if its below definied number in constant?
    Geändert von Demondays (30.11.2015 um 19:16 Uhr)

  12. Beiträge anzeigen #32 Zitieren
    Dea
    Registriert seit
    Jul 2007
    Beiträge
    10.446
     
    Lehona ist offline
    Zitat Zitat von Demondays Beitrag anzeigen
    Is the damage setted in this function still taking into consideration target armor or is it final? I mean for example, if I set it to do 100 magic damage and my target will have 50 magic defense, it will ignore my victim defense and deal 100 damage or only 50? Also what with minimal damage gothic uses? With this function Gothic ignores it or it will still apply min damage if its below definied number in constant?
    It's the final damage. I think it factors in the minimal damage before (a script constant set to 5 in G2), so whatever damage you set will be applied.

  13. Beiträge anzeigen #33 Zitieren
    Ranger Avatar von Demondays
    Registriert seit
    Feb 2015
    Beiträge
    173
     
    Demondays ist offline
    Zitat Zitat von Lehona Beitrag anzeigen
    It's the final damage. I think it factors in the minimal damage before (a script constant set to 5 in G2), so whatever damage you set will be applied.
    Thank you for your answer (once again ). So I will have to include dmg reduction for defense in the function myself... Well forgive me being a noob, but could you explain to me how the function should look if I want to modify spells damage? To be specific I need to give all spells percentage bonus damage. The amount of additional %dmg will change with the level of the equipped item (beliar claw to be specific). I think I got this part right, but I have a problem with linking it to the dmg formula calculation. I created something like this (basing on the meele script), but its still not correct.

    Spoiler:(zum lesen bitte Text markieren)
    Code:
    func int dmg_ondmg(var int victimptr, var int attackerptr, var int dmg) {
        var c_npc slf;
        var c_npc oth;
        var int defense;
        var C_SPELL activespell;
        var int spelldmg;
        
        slf = _^(attackerptr);
        oth = _^(victimptr);
        
        activespell = Npc_GetActiveSpell(slf);
        spelldmg = activespell.damage_per_level;
        if(activespell.damagetype == dam_magic){
            defense = oth.protection[PROT_MAGIC];
        }
        else if(activespell.damagetype == dam_fire){
            defense = oth.protection[PROT_FIRE];
        };
        if(Npc_GetActiveSpell(slf) != -1)
        {
            if(npc_isplayer(slf) && BeliarClawSpellDmgBonusOn == TRUE) 
            {
                dmg = ((spelldmg + ((spelldmg * BeliarCurrentSpellDamageLvl) / 100)) - (defense));
            };
        };
        return dmg;
    };

  14. Beiträge anzeigen #34 Zitieren
    now also in your universe  Avatar von Milky-Way
    Registriert seit
    Jun 2007
    Beiträge
    15.205
     
    Milky-Way ist offline
    What is not working with your script? It always helps to know what exactly the problem is because it gives us a hint about the line we should look at


    Overall, working with spells is tricky. If the player used a scroll and he used the last one he had, Npc_GetActiveSpell(slf) might not work properly anymore by the time the damage function is called. Similar problems may arise when the spell pfx travels a while, and the player switches to a different spell / weapon before the damage is dealt.
    Maybe the problem you are noticing is related to one of these issues.

  15. Beiträge anzeigen #35 Zitieren
    Ranger Avatar von Demondays
    Registriert seit
    Feb 2015
    Beiträge
    173
     
    Demondays ist offline
    Zitat Zitat von Milky-Way Beitrag anzeigen
    What is not working with your script? It always helps to know what exactly the problem is because it gives us a hint about the line we should look at
    I get error upon compilation: Func does not return - instance , on the line:
    Code:
    activespell = Npc_GetActiveSpell(slf);
    I think it is something trivial but I cant figure it out.

  16. Beiträge anzeigen #36 Zitieren
    Veteran
    Registriert seit
    Jan 2012
    Beiträge
    681
     
    Frank-95 ist offline
    Npc_GetActiveSpell return an int, not a C_SPELL. In particular it will return the index declared in constants.d.

    For example: if the active spell is a fireball, the function will return 23 because:
    Code:
    const int SPL_InstantFireball = 23;
    I actually don't know if you can get the C_SPELL instance in anyway. Moreover if you read what milky way told you, and what lehona told me some months ago (some posts above), you will understand that it's non trivial to manage spells' output damage.
    Geändert von Frank-95 (01.12.2015 um 10:28 Uhr)

  17. Beiträge anzeigen #37 Zitieren
    Ranger Avatar von Demondays
    Registriert seit
    Feb 2015
    Beiträge
    173
     
    Demondays ist offline
    Zitat Zitat von Frank-95 Beitrag anzeigen
    Npc_GetActiveSpell return an int, not a C_SPELL. In particular it will return the index declared in constants.d.

    For example: if the active spell is a fireball, the function will return 23 because:
    Code:
    const int SPL_InstantFireball = 23;
    I actually don't know if you can get the C_SPELL instance in anyway. Moreover if you read what milky way told you, and what lehona told me some months ago (some posts above), you will understand that it's non trivial to manage spells' output damage.
    Thanks for the explanation! I didnt mean whole "managing spells' output damage" issue being trivial but only understanding the error I was getting upon compilation, which you explained to me So if I understood correctly there might be serious problem to make the function detect what spell is currently in use and get its damage_per_level/damagetype atumatically... Well, I can always set every spell manually like this:

    Code:
    func int dmg_ondmg(var int victimptr, var int attackerptr, var int dmg) {
        var c_npc slf;
        var c_npc oth;
        var int defense;
        var int activespell;
        var int spelldmg;
        
        slf = _^(attackerptr);
        oth = _^(victimptr);
        
        activespell = Npc_GetActiveSpell(slf);
    
        if(activeSpell == SPL_InstantFireball)
        {
            spelldmg = SPL_DAMAGE_InstantFireball;
            defense = oth.protection[PROT_MAGIC];
        };
        if(Npc_GetActiveSpell(slf) != -1)
        {
            if(npc_isplayer(slf) && BeliarClawSpellDmgBonusOn == TRUE) 
            {
                dmg = ((spelldmg + ((spelldmg * BeliarCurrentSpellDamageLvl) / 100)) - (defense));
            };
        };
        return dmg;
    };
    It would look like this with of course if(activeSpell == ...) for every damage spell. Maybe it could be done some easier way?

  18. Beiträge anzeigen #38 Zitieren
    Veteran
    Registriert seit
    Jan 2012
    Beiträge
    681
     
    Frank-95 ist offline
    The fact is that, as already said, the active spell may differ from the "travelling spell".

    For example: I have only one spell of fireball, which I cast upon a pretty far target. As soon as I cast it the scroll stack empties up, so at the moment of the collision Npc_GetActiveSpell might return an invalid index since you don't have any active spell! I don't know how much time passes from the cast the the deselction of the spell, but, as long as we assume that target is far enough, it's very likely that your script won't work as you wish.
    That example works also for runes or scrolls stack with more than one scroll. Nothing would prevent the player to change spells while the projectile is still in air, so you would return the damage of the CURRENT spell, not the last casted.

    Makes sense?

    EDIT: you could have even more problems with charge spells, since the damage depends upon the time spent charging!

  19. Beiträge anzeigen #39 Zitieren
    research Avatar von NicoDE
    Registriert seit
    Dec 2004
    Beiträge
    7.409
     
    NicoDE ist offline
    Zitat Zitat von Frank-95 Beitrag anzeigen
    The fact is that, as already said, the active spell may differ from the "travelling spell".
    That's the reason why the externals Npc_GetLastHitSpellID and Npc_GetLastHitSpellCat have been introduced with Gothic II.
    The offender's LastHitSpellID and LastHitSpellCat is set directly before AssessMagic is send by the VisualFX.
    "Unter diesen schwierigen Umständen bin ich mir sicher, daß diese guten Menschen meinen augenblicklichen Bedarf an deren Gold verstehen werden." -- Connor

  20. Beiträge anzeigen #40 Zitieren
    Dea
    Registriert seit
    Jul 2007
    Beiträge
    10.446
     
    Lehona ist offline
    Zitat Zitat von NicoDE Beitrag anzeigen
    That's the reason why the externals Npc_GetLastHitSpellID and Npc_GetLastHitSpellCat have been introduced with Gothic II.
    The offender's LastHitSpellID and LastHitSpellCat is set directly before AssessMagic is send by the VisualFX.
    Which is probably too late if you cleanly want to change the damage

Seite 2 von 6 « Erste 123456 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