Jump to content

Spell Scripting Help


jamochawoke

Recommended Posts

Ok I am playing around with werewolf models and textures from different mods today for fun. I got most everything to work except the spell).

 

I wanted to make a spell they cast on themselves that would work with a howl animation I added in as a castself animation file.

 

What I want the werewolf to do is once it becomes aware of a player or enemy NPC it casts a quick speed buff on itself with the damage health graphic (the red particle effect) and play a sound file. I have the combat style of the werewolf set to "daedroth" because I noticed they use a quick buff spell when they go into battle and use their castself animation.

 

I know you have to make a custom spell and then add "script effect" to its effects to get it to work.

 

Now what I first did was to make this script:

scriptname WerewolfHowl

Begin ScriptEffectStart
PlaySound WerewolfHowl
End

 

and appended it to a custom wolfhowl spell I called Bloodlust with the effect of Damage Health for the visual. However, the werewolf in-game never cast the spell, just proceeded to melee me like usual.

 

So I changed the spell to also have the added effect of Fortify Attribute: Speed (20). Now when I went into the game the werewolf did cast the spell, however I noticed it used the Restoration graphic of Fortify Attribute and not the Damage Health effect I had put in the script box. I looked up the spell in the CS and lo and behold the Fortify Attribute part of the spell bumped itself over the Script part of the spell. To top it off, this script crashed my game to desktop after the howl sound started to play. No matter what I would do though Fortify Attribute would always bump itself over any script effect I loaded and play its effect instead of the ones I selected. This is getting frustrating!

 

So I then changed the scripted spell to this:

 

scriptname WerewolfHowl

Begin ScriptEffectStart
PlaySound WerewolfHowl
Cast WolfSpeed 'Werewolftest' (010015AE)
End

 

Wolfspeed is just a generic Fortify Attribute: Speed spell I cooked up.

 

'Werewolftest' (010015AE) is the reference id of the werewolf NPC I dropped into the game. However, the script editor kept telling me this is not a valid object reference.

 

So obviously I have no idea what I am doing and I need real help.

 

Any takers?

Link to comment
Share on other sites

Ok, thanks. I'll try that with the reference ID and see if it works.

 

However, I still think I am going about this in a convoluted way. Is there any way to get this idea:

 

What I want the werewolf to do is once it becomes aware of a player or enemy NPC it casts a quick speed buff on itself with the damage health graphic (the red particle effect) and play a sound file.

 

done any cleaner?

Link to comment
Share on other sites

Ok so I got the game to stop crashing. Apparently I had a duplicated reference in there somehow so it was trying to call on two things at once.

 

The wolf casts the spell every time it becomes aware of an enemy so I'm not really worried about that.

 

Mainly I'm worried about the graphic of the spell. Having it look like he's healing himself again and again is kind of annoying.

Link to comment
Share on other sites

Yeah but the nice thing about it now that I've noticed is that if you can't beat the wolf and decide to turn tail and run... usually he has the spell ready to cast again and you hear another HAAAROOOO and he instantly catches up to you from the speed buff.

 

Makes him kind of extra nasty and I like that :). Adds a bit more atmosphere too.

 

If I can't figure anything else out I'll definitely try the OnStartCombat line.

 

I know there is a way to get spells to always use a custom shader. I've seen it done in mods like Midas but I can't for the life of me figure it out.

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...