Author Topic: generic spellhook script  (Read 680 times)

Legacy_WhiZard

  • Hero Member
  • *****
  • Posts: 2149
  • Karma: +0/-0
generic spellhook script
« Reply #15 on: May 17, 2012, 02:28:44 am »


               

acomputerdood wrote...
i guess my question is: i assume they were using the custom spells before, right?  if you overwrite the spell file, then monsters will use that instead of the original bioware one?  so by deleting my overwritten ones, then monsters revert back to the originals.  correct?


Correct, though the originals will respect whatever include they were compiled with, which will not reflect changes you have made to those includes.
               
               

               
            

Legacy_Shadooow

  • Hero Member
  • *****
  • Posts: 7698
  • Karma: +0/-0
generic spellhook script
« Reply #16 on: May 17, 2012, 06:42:38 am »


               

acomputerdood wrote...

after about 3 or 4 of them, i realized that monsters don't use the spellhooks because i didn't set the special monster variable.  so then they'll never use the custom spells i've been converting over.

i guess my question is: i assume they were using the custom spells before, right?  if you overwrite the spell file, then monsters will use that instead of the original bioware one?  so by deleting my overwritten ones, then monsters revert back to the originals.  correct?

next i need to figure out if i really care about that or not.

This is exactly the reason why I allowed in community patch to change the iternal spellhook without need to recompile all spellscripts.

So two options, either use community patch or at least spellscripts from it.

Or modify x2_inc_spellhook, function X2PreSpellCastCode to run generic spellhook for monster as well and then recompile all spell scripts. Since you have them all in your module already it shouldn't be problem.
               
               

               
            

Legacy_acomputerdood

  • Sr. Member
  • ****
  • Posts: 378
  • Karma: +0/-0
generic spellhook script
« Reply #17 on: May 17, 2012, 10:15:31 am »


               yeah, but i've been trying to delete all of the custom spell scripts from the module and rely on the spellhook to handle my custom spells.

it seems....  cleaner?  definitely more module resource limit friendly at the least.  there are 100s of scripts that are being condensed down into just one.
               
               

               
            

Legacy_Shadooow

  • Hero Member
  • *****
  • Posts: 7698
  • Karma: +0/-0
generic spellhook script
« Reply #18 on: May 17, 2012, 03:54:30 pm »


               Well then you have two options: either you move the recompile spellscripts into override/hak or you try my community patch, then you delete all spellscripts in your module and then you can change the internal spellhook to trigger generic spellhook for monsters as well. This way it won't need further spells recompiling at all since I rewritten the internal spellhook to use ExecuteScript.

Hmm reading myself, may be hard to understand, I try it again:

- You need to change internal spellhook (x2_inc_spellhook) to trigger generic spellhook for everyone not just PC.
- To do this you need to recompile all spells with modified x2_inc_spellhook library and then put them to your module/hak/override
- Or you can download community patch and then:
- delete current spells
- change script 70_spellhook that is new internal spellhok that doesn't need recompiling

Understandable?
               
               

               
            

Legacy__Guile

  • Hero Member
  • *****
  • Posts: 1308
  • Karma: +0/-0
generic spellhook script
« Reply #19 on: May 17, 2012, 04:40:08 pm »


               You could just put a conditional statement in the spell scripts..

If(GetIsPC(OBJECT_SELF))
{
// then run this spell script...
}
else
{
// else run this spell script for all Non-PCs...
}