Jump to content

Need Help with Scripting


taxthevile

Recommended Posts

Hi there! This is my first post, seeing as I could really use some help here.

 

I've made a custom spell that generates a large explosion radius, and I have a tiny problem there. When I cast it, the explosion hits both enemy targets and people I don't want to hit, especially guards and followers.

 

The spell is just like fireball, only a little bigger. What I want to happen is:

 

1) The spell to NOT damage people in my follower faction

 

2) The spell to ONLY damage people that are aggressive towards me or my followers.

 

3) The spell to NOT make people that are hit or within the radius aggressive.

 

I'm not very experienced with scripts, so if there is a "NoAlertTrigger" script already in Skyrim, then feel free to tell me how to work it!

 

Thank you very much for any help or comments!

 

My other scripting question is kind of like the light switch script.

 

I've seen it before in other mods - What I want to do is pull a lever, or other activator, and when you pull it, water starts flowing.

 

So you pull the lever one way, water comes out. Pull it the other way, water stops flowing.

Edited by taxthevile
Link to comment
Share on other sites

I'm not sure what you mean/need by a "NoAlertTrigger" script, but I think I can help with the spell issues. Find the MagicEffect(s) associated with your spell and add some Conditions. For Conditions, try the IsHostileToActor function.

Link to comment
Share on other sites

Okay, I found the "IsHostileToActor" script in my spell's effect boxes, but I'm not sure how to set this up. Do I make two scripts, one for me and one for my faction? But I don't see how that prevents the spell from causing damage to those around me, instead of ONLY damaging an aggressive creature or person.

 

My goal in this spell is to have it do no damage whatsoever to any of the player's allies. Those allies being Hold Guards, followers, a spouse, a quest follower, and anyone else that isn't trying to kill the player.

Link to comment
Share on other sites

I haven't tried it but I would suggest that you simply open up the Magic Effect that is associated with your spell. Then, in the Conditions box, create a new Condition. Have the Condition "Run on" Subject, use the Function IsHostileToActor, and just hit OK. If it works, terrific! This menas that this spell can even be used properly by Followers and other NPCs (even enemies). If it doesn't, open up the Condition again. Click on [TARGET], and edit it such that you select PlayerREF. Hit OK and save your work. This will be sufficient enough to work based on your criteria if only the Player will use the spell. If other NPCs use the spells, the effects will be less desirable. If your follower is using it, it's not a big deal in most situations because most enemies that are hostile to him/her will also be hostile to you. If an enemy uses it they might damage themselves, but won't do any damage to you. If this still doesn't work properly, then IsHostileToActor is not the function that we need.

Link to comment
Share on other sites

Hmm, well I tried the IsHostileToActor, on the spell's effects but Guards and people were still aggressive when I used the spell on near them. So IsHostileToActor might not be right? Oh sorry I post these so late, I hardly have time to get around to Skyrim till late at night.

Link to comment
Share on other sites

Well everybody, I'm still stuck with the above questions. The IsHostielToActor with the target set to the Player Ref still damaged friendly NPC's and followers. Any help at all with this problem would be a great help!

 

I may as well add my other question as well.

 

My other scripting question is kind of like the light switch script. I've seen it before in other mods - What I want to do is pull a lever, or other activator, and when you pull it, water starts flowing. So you pull the lever one way, water comes out. Pull it the other way, water stops flowing.

 

Any help on either of these would be most appricated!

Link to comment
Share on other sites

  • Recently Browsing   0 members

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