Aller au contenu

Photo

MySavingThrow Function - Immunity Question


  • Veuillez vous connecter pour répondre
47 réponses à ce sujet

#26
Lance Botelle

Lance Botelle
  • Members
  • 1 480 messages

BartjeD wrote...

This is the code that deals with the Spell Immunity and Spell Absorption effects. (decrease levels left etc..)
I think this is what you need but I can also PM you the entire function if you want. (it might bloat the page)

http://pastebin.com/VbL3Lk97 - probably copy this into a script from the raw paste so it'll read better :)

You'll notice what I'm doing with the loop here, reading out the structure of the applied effects and using that as data for the function to see what should happen. This doesn't work for items though because items don't apply an effect on the player that will be returned this way (immunity: death or immunity: magic missile) - Instead you need to work around that as you can see at the bottom by detecting an item property on an equipped item.

Using the same kind of loop I can change an effect that is applied through an effect applying wrapper function. So I can tell it to switch damage cold to damage type fire, or not to apply to friendly target, or don't kill anyone or apply half damage as fire and half as cold etc.. Endless possibilities and it means I won't have to recode every spell with all these options. I can just do that through the effect applying wrapper instead from a central location.

We have that code currently online as well but the feats to use it still need to be added into the 2da, such as a mage's damage substitution or a High Arcana ability that allows you to not hurt friendlies that are in your spells and AOE's.
It's also quite a pickle to balance because a Frost Mage has the ability to ignore resistances with his Cold Spells but if he was to take Damage Subsitution Cold then he could suddenly be doing cold damage with a lot of spells (flame arrow etc..) which would then logically also have to ignore all resistances.


----
If you're interested I've also coded a Counterspelling system using the spell hook which works real neat. It allows both PC's and NPC's to do exactly as described in standard PnP for counterspelling. You can even counter dispels with other dispel spells. :lol:
It's also tested and online already but again - the feats to use it still need to be added. Much balance considerations to make on that. (Mastery Counterspelling for example turns back all counterspelled spells - that could be murderous)


Hi BartjeD,
Thanks for showing me your code. That is big! ... And probably a little more than I was after at this stage ... let alone your counterspelling work as well. Image IPB Still, it is good to know (like with Pain's work) that there are alternatives to look at and use if need be, designed by people with a passion for it, like yourself.

In the meanwhile, I have confirmed that simply by adding my homebrew gaze effect as a line in the spells.2da and adding a valid value in the IMMUNITYTYPE column makes my own script work (with respect to immunities) if it is applied with ActionCastSpellAtObject function. That is comforting to know. As it happens though, I have to apply this script directly as part of the cerature's AI, so I still have to code my own immunity checks after all. Image IPB

It is good to know how the immunity checks work though ... a column check in the spells.2da.

Lance.

Modifié par Lance Botelle, 08 octobre 2011 - 08:04 .


#27
painofdungeoneternal

painofdungeoneternal
  • Members
  • 1 799 messages

BartjeD wrote...
Yes I've seen Pain's work and its really well done but Last time I saw it that package was still using the default NWN2 SR function to handle Spell Absorption and Spell Immunity.


I have had custom code for both of those for a long time.

I left it in, since it could do no harm, and i was using it as a backup as i learned more situations for when it was needed. That kind of got messed up when i integrated the AI, but it was just something i could comment out at that point.

Also have counterspelling working as well, per pnp rules.

Modifié par painofdungeoneternal, 08 octobre 2011 - 02:45 .


#28
BartjeD

BartjeD
  • Members
  • 249 messages
I was misled by this comment when I checked if you had already found a solution:

04880 iResistCheckResult = HkCheckSpellMantle(oCaster, oTarget); // this runs old resistspell function


Now I have gone and reinvented wheel!  *face palm*
I've sent you my Counterspelling code so we can compare, I noticed we did it very differently with both the SR and counterspelling scripts.

Modifié par BartjeD, 08 octobre 2011 - 03:04 .


#29
mogromon

mogromon
  • Members
  • 41 messages
well darkness immunity is recognized in my game, just changed the resistspell function and it works as expected while using helm of darkness (that makes you immune to Darkness). though it doesnt matter since there is no point in being immune to darkness

about EffectDeath i started doing some tests. Added EffectImmunity(IMMUNITY_TYPE_DEATH) to the dummy in JEG's training module, and cast finger of death on it, saving throw failed and target is immune to death effects, i noticed that in one attempt the dummy got a natural 20 in its saving throw and finger of death did negative damage to it (does this mean that a natural 20 overrides automatic failing in case the target is immune????). Then i decided to make a apply a custom spell EffectDeath on the dummy and it died despite being immune to death effects, so maybe applying the EffectDeath so it checks if target is immune first, only works in specific spells (default ones??). Also tried using Signalevent... line but nothing changed. Using GetIsImmune and using SendMessageToPC should have the same impact so no need to complicate things.

#30
kevL

kevL
  • Members
  • 4 052 messages

painofdungeoneternal wrote...

Then go ahead and delete ALL the folders except the folder CSLLibrary as the rest are just implementation scripts.

bingo

#31
Lance Botelle

Lance Botelle
  • Members
  • 1 480 messages

mogromon wrote...

well darkness immunity is recognized in my game, just changed the resistspell function and it works as expected while using helm of darkness (that makes you immune to Darkness). though it doesnt matter since there is no point in being immune to darkness

about EffectDeath i started doing some tests. Added EffectImmunity(IMMUNITY_TYPE_DEATH) to the dummy in JEG's training module, and cast finger of death on it, saving throw failed and target is immune to death effects, i noticed that in one attempt the dummy got a natural 20 in its saving throw and finger of death did negative damage to it (does this mean that a natural 20 overrides automatic failing in case the target is immune????). Then i decided to make a apply a custom spell EffectDeath on the dummy and it died despite being immune to death effects, so maybe applying the EffectDeath so it checks if target is immune first, only works in specific spells (default ones??). Also tried using Signalevent... line but nothing changed. Using GetIsImmune and using SendMessageToPC should have the same impact so no need to complicate things.


Hi mogromon,

Because the death effect is an "effect" rather than a "spell", and the immunity you have added is against the "death effect" rather than the "Finger of Death" spell, then the spell still fires and the PC is subject to the spell code. (If you had made the immunity to the FoD spell, then I believe the game says the PC is immune to the entire spell - and possibly stops the script from going any further. I still need to check this though.) However, because MyResistSpell uses the ResistSpell function, I do not think the immunity for the effect is checked here. (I have not yet confirmed if the ResistSpell function does return a 2 if the PC is immune. NB: The MySavingThrow function does not, even though it says it does.)  So, when a PC with immunity to death has FoD cast at them, the FoD script fires .... and I suspect the following happens:-

1) The MyResistSpell (using ResistSpell function) of the FoD spell does *not* actually do the immunity checking, but allows the current testing to return only results of resistance to do with spell resistance. For although it does say that it is checking for magic immunity and spell absorption in the function description as well, I am not convinced this is the case yet. (I need to check this some more.) It may well work for spell absorption, but I have an inkling feeling that the magic immunity part (like that in the MyResistSpell part) may have been altered to be ignored at this stage, because of your description of your results and the way I think it may now work. (See next.)

2A) If your PC makes a save (like the 20 result), then they would have not encountered the death result of the spell to which they would have been immune (and checked for after the spell - see next.) The FoD spell gives a result of negative damage if they save against the potential primary death result of the FoD spell.
2B) If your PC fails the save and is about to take the potential death result of the FoD spell, then after the spell code has run, if the spell is present in the spells.2da then anyone who is immune to death does not have the death effect result. Hence, it is only at this stage (after the spell has gone its full course) when an effect of a spell is checked. In other words, in this particular case, it would pay for the PC to FAIL their saving throw against the FoD spell and take the death result, to which they are immune. Saving in this case does them no good, because the "saved result" is negative energy instead, to which they are not immune!

3) As for your custom spell, this is the exact same result I had and is why I started these posts. It turns out that the FAILED result occurs, even when immune, because the script you are using needs to be assigned a line in the spells.2da and hard-coded checks spells from here. (I originally said they IMMUNITYTYPE column bore a relevance, but I no longer think this is the case. Simply being present in the spells.2da appears to make the immunity check work.) Using just script with functions like MySpellResist and MySavingThrow DO NOT WORK, because the checks v death (or other immune effect) are made via the spells.2da and applied just prior to the effect taking place. So, to make your custom spell work with the item immunities you need to (like the offical spells) add it to the spells.2da.

4) If your spell/effect script is not going to be used as a spell (as such) and used (like I have) as part of a creature AI, then you are correct in saying that the GetIsImmune checks need to be added to the script to ensure immunities are not ignored when the script is written and used in this way.

I think the primary lesson I have learned here is that effect immunities are handled via the spells.2da and have nothing to do with the MyResistSpell and MySavingThrow functions, as I first thought.

Lance.

EDITED TO REMOVE PRIOR THEORY ABOUT IMMUNITYITEM COLUMN WHICH NOW APPEARS INCORRECT

Modifié par Lance Botelle, 08 octobre 2011 - 07:00 .


#32
Lance Botelle

Lance Botelle
  • Members
  • 1 480 messages
Hi All,

OK, I have confirmed the following to date ..... for my hag gaze script called  alb_hag_gaze, which is a simple rework of the normal death gaze script, and uses all the same resistance and save function checks.

1) If I call my script via ExecuteScript, then the immunity checks do not work when I wear an immunity to death item.

2) If I add the hag gaze to the spells.2da (say line 1713) and call this script using a line of code along the lines of: ActionCastSpellAtObject(1713, oPlayer, METAMAGIC_ANY, TRUE); then the immunity checks work.

Therefore, all I can conclude is that the immunity checks are made outside of scripting and if I design any new effects or spells that are not added to the spells.2da and thereafter called via normal spell calling methods, then I need to add trhe immunity checks manually. E.g. Creature AI scripts called via ExecuteScript require the extra checks adding.

Lance.

#33
kevL

kevL
  • Members
  • 4 052 messages
lol, my hezrou with beefed-up Death Gaze just gazed himself to death!!

I think what happened is he cast it, as it was rushing towards my PC, and got caught in its own AoE cone .....


putting in code to stop that,

while (GetIsObjectValid(oTarget) && oTarget != OBJECT_SELF)


[ EDIT, slight correction in case anyone's actually reading: code above could knock itself out of Loop prematurely; instead, put check for !OBJECT_SELF into subsequent line along w/ check for spellsIsTarget( ) ]


Ps. quick tests re-confirm that ImmunityType column does *nought. ( "Negative", "Death", "****" all result in successful immunity check if subject is immune )

gratz, Lance.

Modifié par kevL, 09 octobre 2011 - 12:31 .


#34
Lance Botelle

Lance Botelle
  • Members
  • 1 480 messages

kevL wrote...

lol, my hezrou with beefed-up Death Gaze just gazed himself to death!!

I think what happened is he cast it, as it was rushing towards my PC, and got caught in its own AoE cone .....


putting in code to stop that,

while (GetIsObjectValid(oTarget) && oTarget != OBJECT_SELF)


Ps. quick tests re-confirm that ImmunityType column does *nought. ( "Negative", "Death", "****" all result in successful immunity check if subject is immune )

gratz, Lance.


Hi KevL,

I had some self-kills in my testing and it appeared to be due to the if (spellsIsTarget(oTarget, SPELL_TARGET_STANDARDHOSTILE, OBJECT_SELF)) line of code. Yet another problem I think, so I changed that to GetIsEnemy, which appeared to work more accurately. Your own line of code would obviously work as well. Image IPB

Yes, I got the same "nought" results as you ... It seems that the immunity checks only work when the spell or effect code is used via CastSpellAtObject type functions, which refer to a spell within the spells.2da ... and is ignored if simply called from an ExecuteScript function. This appears anti-intuitive to me, as I would have thought it to be a simple case of effect checked verses a potential immunity present ... period. I guess the hard coded "hooking" method for checking does not work like this.

Lance.

Modifié par Lance Botelle, 08 octobre 2011 - 08:14 .


#35
kevL

kevL
  • Members
  • 4 052 messages
Image IPB

jah, what set me off to the idea that a custom spellscript has to be (?) defined in Spells.2da, is that whenever reading documentation (sparse as it is) about spells, is how the term "spellscript" was being used ... i always wondered why are they being so darn specific about that term, guess we know now

#36
mogromon

mogromon
  • Members
  • 41 messages

Lance Botelle wrote...

3) As for your custom spell, this is the exact same result I had and is why I started these posts. It turns out that the FAILED result occurs, even when immune, because the script you are using needs to be assigned a line in the spells.2da and hard-coded checks spells from here.


I use a custom spell with its own line in spells.2da for testing purposes, also i use it via the gui used normally to cast spells, so there is no difference there between my custom spell and let's say finger of death. After i read this i decided to do an extra test since my custom spell uses a delayed function to add several effects in sequence (ie first apply EffectImmnunity and after a few seconds run the function again but now apply to EffectDeath effect), and in this case the immunity to death effects didnt work.

I decided to do it using the same spell but applying the EffectDeath in the main script without using the function and the Immunity kick in, then decided to do a test using DelayCommand, and it didnt work, so i guess it must be used without delayed and i got the next results:
- EffectDeath can't be created in a delayed function (or a inside a delayed applyeffect) for it to detect Immunity to Death
- You can apply a death effect in a delaycommand applyeffect or a delaycommand function, and will detect Immunity as long as the EffectDeath was created without any delays (like main())

Looking at the code you posted, it should be able to detect immunity to death magic, so you may be rigth in saying it must be done within a spells.2da spell

#37
Lance Botelle

Lance Botelle
  • Members
  • 1 480 messages

kevL wrote...

Image IPB

jah, what set me off to the idea that a custom spellscript has to be (?) defined in Spells.2da, is that whenever reading documentation (sparse as it is) about spells, is how the term "spellscript" was being used ... i always wondered why are they being so darn specific about that term, guess we know now


Ha! You know what ... I always wondered the same thing ... and I guess you could well be right about it in this manner. Maybe someone will confirm it one way or another.

Lance.

#38
Lance Botelle

Lance Botelle
  • Members
  • 1 480 messages

mogromon wrote...

<SNIP>

Looking at the code you posted, it should be able to detect immunity to death magic, so you may be rigth in saying it must be done within a spells.2da spell


Hi mogromon,

As you say, I think this must be the case ... You can test your own scripts further if you like by ...

1) If you have any code that currently works with immunity tests, try using the exact same script via the ExecuteScript function and you should find (if my theory is correct) that immunity checks fail.

2) If you test the same script using CastSpellAtObject (which references the spells.2da line), then the exact same code should correctly find the immunity in place.

EDIT: Just be sure that the code you are testing does not have anything that would stop it from working for any other reason. E.g. If you are testing the code from a placeable object, which obviously would fail a "sight" test (if implemented) as it is not a creature, which would end the script prematurely.

EDIT 2: See my next post to see an example of the same code working or failing to detect immunities subject to how it is called.

Lance.

Modifié par Lance Botelle, 08 octobre 2011 - 09:07 .


#39
Lance Botelle

Lance Botelle
  • Members
  • 1 480 messages
Hi All,

Here is a very simple demonstration of the same code that works or fails to detect immunities under different conditions.... it is using a slightly modified official campaign nw_s1_gazedeath script.

1) Create a useable lever, named DEATHTEST, with this in its OnUsed hook:

[nwscript]
void main()
{
 object oPlayer = GetLastUsedBy();  
 
 if(GetName(OBJECT_SELF) == "DEATHTEST")
 {
  // USED TO TEST SPECIFIC SPELL IMMUNITY (APPEARS TO BE HARD CODED FOR ITEMS)
     
  //ActionCastSpellAtObject(253, oPlayer, METAMAGIC_ANY, TRUE); // UNREM TO TEST IMMUNE WORKING
  ExecuteScript("nw_s1_gazedeath", oPlayer);   // UNREM TO TEST IMMUNE FAILING
 
  }
}[/nwscript]

REM or UNREM the method you are testing. The above is currently set to show the script failing to detect immunities. Swapping the REM lines around will test the script with the immunities working.

2) Import/copy this code to a script called nw_s1_gazedeath. Note, when you do this, it will make a temporary version of the official nw_s1_gazedeath script, which you can use for testing. Just remember to delete it from your scripts tab after you are finished testing to revert back to the original official script.

This copy of the nw_s1_gazedeath script has been slightly modified to allow it to work properly: It now works with a placeable object and has a good range and hard to pass DC. Feel free to compare it to the original:

[nwscript]
#include "X0_I0_SPELLS"
void main()
{
    if( GZCanNotUseGazeAttackCheck(OBJECT_SELF))
    {
       // return;
    }
    //Declare major variables
    int nHD = GetHitDice(OBJECT_SELF);
    int nDuration = 1 + (nHD / 3);
    int nDC = 40 + ( nHD / 2 );
    //location lTargetLocation = GetSpellTargetLocation();
 location lTargetLocation = GetLocation(OBJECT_SELF);
    object oTarget;
    effect eGaze = EffectDeath();
    effect eVis = EffectVisualEffect(VFX_IMP_DEATH);
    //Get first target in spell area
    oTarget = GetFirstObjectInShape(SHAPE_SPHERE, 10.0, lTargetLocation, TRUE);
    while(GetIsObjectValid(oTarget))
    {
        if (spellsIsTarget(oTarget, SPELL_TARGET_STANDARDHOSTILE, OBJECT_SELF))
        {
            //Fire cast spell at event for the specified target
            SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, SPELLABILITY_GAZE_DEATH));
            //Determine effect delay
            float fDelay = GetDistanceBetween(OBJECT_SELF, oTarget)/20;
            if(!MySavingThrow(SAVING_THROW_WILL, oTarget, nDC, SAVING_THROW_TYPE_DEATH, OBJECT_SELF, fDelay))
            {
                //Apply the VFX impact and effects
                DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget));
                DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, eGaze, oTarget));
            }
        }
        //Get next target in spell area
        oTarget = GetNextObjectInShape(SHAPE_SPHERE, 10.0, lTargetLocation, TRUE);
    }
}
[/nwscript]

3) Make an item with Death Immunity that the testing PC can wear. Then have them pull the lever to test the same script under different callings. REM/UNREM the lines in the lever's OnUsed script between tests.

Lance.

Modifié par Lance Botelle, 08 octobre 2011 - 09:08 .


#40
The Fred

The Fred
  • Members
  • 2 516 messages
Just something of an FYI from the other thread:

Lance Botelle wrote...
It's when you find such things as Spell Immunity: Gaze, Petrification in the options for items specific spell immunity that confuses the issue then.  Although not the Daze example you give, I was not expecting to find Gaze, Petrification there either, but I did. In testing, however, this particular "spell immunity" does not work, as (I suppose) we should expect.

Yes, that's confusing, but there reason for that is that the immunity to a specific spell item property looks to the spells.2da for its values, IIRC, so it will list every "spell" in there. It doesn't work, because it's not scripted to.


From what I understand to date, then, and please correct me if you think I have this wrong ....

Lance Botelle wrote...
1) Specific spell immunities that are added to items are checked via some hard-coding. E.g. A ring with spell Immunity: Magic Missile. When this spell is targeted at a PC with the ring, the immunity is checked *prior* to the spell scripts firing?

Apologies if you've already got there, but no, that's not the case. Immunity to a specific spell is checked in each spell's script. It's the MyResistSpell() function which does it I think, via ResistSpell() or whatever it is.

That's why being immune to a monster ability does nothing, whereas you can be immune to a spell. However, you can be immune to the effects that the said monster ability causes.

#41
Lance Botelle

Lance Botelle
  • Members
  • 1 480 messages

The Fred wrote...

Just something of an FYI from the other thread:

Lance Botelle wrote...
It's when you find such things as Spell Immunity: Gaze, Petrification in the options for items specific spell immunity that confuses the issue then.  Although not the Daze example you give, I was not expecting to find Gaze, Petrification there either, but I did. In testing, however, this particular "spell immunity" does not work, as (I suppose) we should expect.

Yes, that's confusing, but there reason for that is that the immunity to a specific spell item property looks to the spells.2da for its values, IIRC, so it will list every "spell" in there. It doesn't work, because it's not scripted to.


Hi TheFred,

This is interesting then ... how come I cannot see my own spells that I have added to the spells.2da listings? Are the potential immune spells listed in another 2da somewhere?

The Fred wrote...

Lance Botelle wrote...
From what I understand to date, then, and please correct me if you think I have this wrong ....

1) Specific spell immunities that are added to items are checked via some hard-coding. E.g. A ring with spell Immunity: Magic Missile. When this spell is targeted at a PC with the ring, the immunity is checked *prior* to the spell scripts firing?

Apologies if you've already got there, but no, that's not the case. Immunity to a specific spell is checked in each spell's script. It's the MyResistSpell() function which does it I think, via ResistSpell() or whatever it is.

That's why being immune to a monster ability does nothing, whereas you can be immune to a spell. However, you can be immune to the effects that the said monster ability causes.


I have not managed to test this yet, but feel I ought to ... just to satisfy myself. I think I will set up some simple text messages to see what results are being returned under what circumstances. Thanks for the heads up though. Image IPB If I do not find anything different, then assume you are spot on and that it is the ResistSpell function that does this.

EDIT: CONFIRMED - The MyResistSpell function *does* work with reference to specific spells as you say. So, this function does work with respect to specific spells only because they are tested *at the time of the spell being cast at the PC*, but effects cannot be tested against, because they get applied *after the spell has taken place*. I guess there must be some sort of "after spell check" made that relates to the way spells are applied using ActionCastSpellAtObject. You would have thought it was possible to have a kind of MyResistEffect function that does a similar check to the specific spell MyResistSpell quivilent function at the time the effect was about to take place.

Lance.

Modifié par Lance Botelle, 08 octobre 2011 - 09:43 .


#42
mogromon

mogromon
  • Members
  • 41 messages
in nwn2.wikia >> spells.2da page, it says in the ItemImmunity that you should add a line into iprp_spellcost.2da so that could be the reason your custom spells are not listed.

Lance Botelle wrote...

but effects cannot be tested against, because they get applied *after the spell has taken place*. I guess there must be some sort of "after spell check" made that relates to the way spells are applied using ActionCastSpellAtObject


Im not sure i follow what you're saying but as far as i can tell every effect added via a spell has a SpellId that you can later check via GetHasSpellEffect, and Remove the using RemoveEffectsFromSpell(you need to include nw_i0_spells IIRC).

Modifié par mogromon, 09 octobre 2011 - 02:59 .


#43
Lance Botelle

Lance Botelle
  • Members
  • 1 480 messages

mogromon wrote...

in nwn2.wikia >> spells.2da page, it says in the ItemImmunity that you should add a line into iprp_spellcost.2da so that could be the reason your custom spells are not listed.

Lance Botelle wrote...<SNIP> 


Im not sure i follow what you're saying but as far as i can tell every effect added via a spell has a SpellId that you can later check via GetHasSpellEffect, and Remove the using RemoveEffectsFromSpell(you need to include nw_i0_spells IIRC).


Hi mogromon,

Thanks for the pointer to the other 2da. You know, I did read that during my investigations, but it did not occur to me at the time.

I think my previous comment (which I have now snipped from here) did not make a lot of sense, so it was my mistake. Sorry about that. Image IPB

I think the bottom line is, calling a spell script via an ExecuteScript function stops some of the immunity check functions from working. I was not aware of this, but obviously am now ... thanks to the help of people like yourself and the many others who gave replies.

Thanks again.

Lance.

#44
painofdungeoneternal

painofdungeoneternal
  • Members
  • 1 799 messages
Stops a lot of things from working...

if you delaycommand or execute ( or even in a spells AOE effect ), the values you are dealing with need to saved somehow and passed or wonkiness will ensue. Many functions ONLY work in a given event and when used in other events work randomly. When ever in these contexts you need to test very carefully, and try to get as much as possible into passed parameters.

( example is getlastdamager, but a more specific example is to just do a grease spell with a dual wiz/cleric, then cast a healing spell, and watch your AOE's DC go crazy since your lastcastclass is now a cleric and it can't figure out how to do the saves for a wizard anymore. )

#45
Lance Botelle

Lance Botelle
  • Members
  • 1 480 messages

painofdungeoneternal wrote...

Stops a lot of things from working...

if you delaycommand or execute ( or even in a spells AOE effect ), the values you are dealing with need to saved somehow and passed or wonkiness will ensue. Many functions ONLY work in a given event and when used in other events work randomly. When ever in these contexts you need to test very carefully, and try to get as much as possible into passed parameters.

( example is getlastdamager, but a more specific example is to just do a grease spell with a dual wiz/cleric, then cast a healing spell, and watch your AOE's DC go crazy since your lastcastclass is now a cleric and it can't figure out how to do the saves for a wizard anymore. )


Hi Pain,

I think I am beginning to see a few examples of this sort of thing going on during some testing. I believe this may also explain why some of my monsters (when summoning a creature to help them), some times had the said creature attack them when the creature was affected by another spell.

AI gets really complicated/wonky at times as you say.

lance.

#46
kevL

kevL
  • Members
  • 4 052 messages
I've noticed this, in a simple way, with the following debug code:

// at start of casting sequence (ie. measures previous spell cast):
SendMessageToPC(oPC, "kL Dragon Spell - start - CasterLevel : "
    + IntToString(GetCasterLevel(oCaster)));

// at end of casting sequence (ie. measures this spell cast):
DelayCommand(0.1f, SendMessageToPC(oPC, "kL Dragon Spell - end - CasterLevel : "
    + IntToString(GetCasterLevel(oCaster))));


- watch the numbers jump around (depending) .. AoE onEnter/onHB could be inspected similarly, i believe

yes, CSL has stuff to enable correcting this ( i believe ) ... s'only a matter of time, & desire.

#47
painofdungeoneternal

painofdungeoneternal
  • Members
  • 1 799 messages
On the tag of the newly created AOE, which is a unique identifier, well i went and packed about 10 values ( DC, Caster Level, Caster Id, Score to Dispel, damage type, spell power in dice, ending round, etc ). Then on as the AOE needs values, it can just examine it's own tag and extract what is needed, even moving those out into variables.

Basically i don't trust anything to just work as is, i pass the correct values which are ONLY known in the initial script. Parameters are something everyone can do, the AOE required a lot more work.

Side effect is improved performance, as a lot of hard to determine values are right at both my and the AI's fingertips.

Modifié par painofdungeoneternal, 11 octobre 2011 - 03:20 .


#48
kevL

kevL
  • Members
  • 4 052 messages
wicked, +10