Aller au contenu

Photo

Spellcasting help


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

#1
aramoro999

aramoro999
  • Members
  • 42 messages
trying to make a script that makes the char cast a spell, the trigger is another spell...
thinking about ActionCastSpellAtLocation and ActionCastSpellAtObject...but to mayn parameters
any faster way than this ?

#2
Morbane

Morbane
  • Members
  • 1 883 messages
ExecuteScript("spell_script_name", oPC); ?

#3
MasterChanger

MasterChanger
  • Members
  • 686 messages
You really want the ActionCastSpell functions. Executing a spell script from a third script is not great because the downstream script wouldn't have the target defined, or metamagic, etc.

If this is for your spellhook plans, I would suggest a different route than re-writing every spell script, though. I've thought about using some of Pain's spellhook work to give various boosts or penalties to spellcasting. I'm pretty sure he has custom caster level boosts and such that depend on environments, spell descriptors, and sub-schools.

Check out the CSL Doxygen pages for more info.

#4
aramoro999

aramoro999
  • Members
  • 42 messages
Thing is i need to modify a bunch of druid spells, and couldn't use anything but to make new 2da entry for them, all i want is to use them instead of their normal spells, while wild shaped

so what if i get all the spells the char has, reduce their uses to zero...
and give them the same amount spells back from the modified 2da entry's ???
is that doable ???

actually anything is good as long as it gets the job done

Modifié par aramoro999, 01 mai 2012 - 07:58 .


#5
aramoro999

aramoro999
  • Members
  • 42 messages
fail...cant increment spell uses...

back to spell-hook maybe

#6
MasterChanger

MasterChanger
  • Members
  • 686 messages

aramoro999 wrote...

fail...cant increment spell uses...

back to spell-hook maybe


Yes, this is a major limitation. If you could do so, it would be much easier to do things like creating alternative magic systems (mana point-based, for example).

There could probably be a NWNX plugin written to make such functions available to nwscript. I haven't requested one because I'm not likely enough to use it to make it worth someone else spending their time on. I don't actually know how much work it would be or indeed if it would be actually be doable, though I imagine it could.

#7
aramoro999

aramoro999
  • Members
  • 42 messages
there is no function to check which spells u have so, probably never meant to have increment either...

about ActionCastSpellAtLocation/object...any way to get past the metamagic problem ??
im not a fan of meta, but some ppl are, and i dont plan to remake every spell just so it works...

#8
aramoro999

aramoro999
  • Members
  • 42 messages
MasterChanger can u explain what u mean by:

"Executing a spell script from a third script is not great because the downstream script wouldn't have the target defined"

cant i just use GetAttemptedSpellTarget ??? or is this function broken as well?

#9
MasterChanger

MasterChanger
  • Members
  • 686 messages

aramoro999 wrote...

there is no function to check which spells u have so, probably never meant to have increment either...

about ActionCastSpellAtLocation/object...any way to get past the metamagic problem ??
im not a fan of meta, but some ppl are, and i dont plan to remake every spell just so it works...


As far as I know, there's only an issue with metamagic if you pass a TRUE bCheat parameter to allow the character to cast a spell they don't technically have. This is possibly an unfortunate limitation in your situation, since the character must actually be able to cast--and possibly have memorized?--the second spell script you want to call.

MasterChanger can u explain what u mean by:

"Executing a spell script from a third script is not great because the downstream script wouldn't have the target defined"

cant i just use GetAttemptedSpellTarget ??? or is this function broken as well?


Basically, spell scripts are only meant to be called as ImpactScripts from a 2da framework, rather than Executing them. All spell scripts have function checks within them for things like the spell ID, the spell target, caster level (which depends on the spell being cast) and so on.

I think there was even a thread recently about how spell resistance checks or something like that did not work if the script wasn't specifically called as a spell this way (though my memory is a little hazier on that one).

#10
aramoro999

aramoro999
  • Members
  • 42 messages
dam...just how many limitations this thing has ?

ActionCastSpellAtLocation/object what cant this function actually do ??

in theory...i cast a spell >> spell hook >> i dont want it...disable spellcasting(so it doesn't get cast)
do all the cheks for pclvl / spell id / and target
and say i use pclvl...and target...exept i use another spell id...no metamagic...and pc knows the spell

will it actually do anything ??

Modifié par aramoro999, 03 mai 2012 - 03:14 .


#11
aramoro999

aramoro999
  • Members
  • 42 messages
stupid question...how does pc and npc get spells in their spell book?

is there a script that adds the spells or a 2da ?

because if there is, i can simple simply get the char to have different spells and forcerest afterwards
and this might just work for what i want to do...