Kish Posted August 2, 2013 Share Posted August 2, 2013 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
Mike1072 Posted August 2, 2013 Share Posted August 2, 2013 Add an effect to the spell that uses opcode 82. Link to comment
Kish Posted August 2, 2013 Author Share Posted August 2, 2013 Thanks. But how do I set a resource for the spell that isn't in the game until the mod is installed? Link to comment
Mike1072 Posted August 3, 2013 Share Posted August 3, 2013 If you're using NearInfinity to edit the spell, you can right click the resource field and edit it as text. You could also write the resource string (or the entire effect) using WeiDU when the mod is installed. Link to comment
Kish Posted August 3, 2013 Author Share Posted August 3, 2013 If I right-click the resource field, click Edit as String, and type in the name of the .baf file, that will work? Link to comment
Mike1072 Posted August 3, 2013 Share Posted August 3, 2013 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
Kish Posted August 22, 2013 Author Share Posted August 22, 2013 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
10thLich Posted August 22, 2013 Share Posted August 22, 2013 You'd have to do it using opcode 177 use eff file, pointing to general.ids with type animal. The eff resource would then use opcode 82. 10th Link to comment
Mike1072 Posted August 22, 2013 Share Posted August 22, 2013 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
Kish Posted August 23, 2013 Author Share Posted August 23, 2013 Thanks. It seems to be working now. Link to comment
Recommended Posts
Archived
This topic is now archived and is closed to further replies.