Jump to content

New spell question


Recommended Posts

I want to create a spell that, when cast, will set an AI script for the creature targeted to a new script which I plan to include with the spell.


How can I do this, as part of a mod?

Link to comment

Yep. It needs to match the resource name of the .bcs file your script gets compiled to. Resource names are filenames minus the extension.


Using COMPILE ~mymod/myscript.baf~ should create a myscript.bcs file in the override. The value to put in your spell effect's resource field would be myscript.

Link to comment

Another question. Is there a way to make the spell only work on animals (creatures of type ANIMAL)? Something that automatically adds to the creature's override script would also work, as long as it leaves the rest of the override script intact.

Link to comment

That's right. You want to use opcode 177 (Use EFF File). It applies an effect only to creatures that match a given IDS entry.


An EFF file can contain a single effect, so if you only need to apply one effect to the matching creatures, just make a new EFF file containing that effect and reference that file from your spell's 177 effect.


If you want to apply multiple effects to those creatures, you could make multiple EFF files and include multiple 177 effects in your spell, but it may be easier to use a single EFF file containing opcode 146 (Cast Spell at Creature). Then you can put all your desired effects into a separate SPL file. Your original spell would have a 177 effect that references the EFF file that has a 146 effect that references the SPL file containing the effects.

Link to comment


This topic is now archived and is closed to further replies.

  • Create New...