Jump to content

DOWNLOAD MODS

Are you looking for something shiny for your load order? We have many exclusive mods and resources you won't find anywhere else. Start your search now...

LEARN MODDING

Ready to try your hand at making your own mod creations? Visit the Enclave, the original ES/FO modding school, and learn the tricks of the trade from veteran modders...

JOIN THE ALLIANCE

Membership is free and registering unlocks image galleries, project hosting, live chat, unlimited downloads, & more...

[SKY] Identifying an incoming spell and what does GetSpellUseNum do?


EpF
 Share

Recommended Posts

I'm trying to make a perk that absorbs magicka only from incoming elemental damage spells, so spells with keywords MagicDamageFire/Frost/Shock, but I can't see if there is a built-in way to identify incoming spells by keyword. I have tried putting target condiions on the Magic Effect that run on the subject and check for HasMagicEffectKeyword, but I can't see a way to make this check run on incoming spells. Would this have to be scripted?

I was also wondering if anyone here can tell me what GetSpellUseNum does, as it isn't explained in the wiki...

Link to comment
Share on other sites

Hi there, just some ideas and comments

You've probably been through all these, but for what it's worth....

Rather then check for what spell is incoming could you check what spell the attacker has equipped?

Once they have chosen an attack method NPC's rarely, if ever swap it up in combat.

It would also get rid of having to check is the attacker actually firing at the player or not.

Also if the attacker is firing in bursts you don’t have to check every time a burst is fired.

Check what the spell is BEFORE it leaves the attacker?

Taking the perk MQBladesDragonInfusion as a reference...

Opening up the perk Entry and going to the Attacker Conditions tab, rather then use keywords

Attacker (S HasKeyword: 'ActorTypeDragon')

how about

Attacker (S IsCurrentSpell xxxxxx )

or

Attacker (S HasEquipedSpell xxxxxx)

Yes you would have to put in a condition for every elemental spell you want to reduce the incoming damage of (if it works) but you never know.

In the attacker weapon tab may be a better place to try but I don’t think the game sees spells as weapons.

Adding other conditions to the attacker such as

IsCasting

IsDuelCasting

May help the other conditions 'fire'

Anyway just some ideas,

KW

PS: i think GetSpellUseNum is the number of times the spell has been cast by player. like when you have to test 10 new firewall spells against undead for j'zargo

Edited by KettleWitch
Link to comment
Share on other sites

Hi KW - Thanks for the input. Unfortunately, because the effect I want to apply is spell absorption, an entry point won't work as there don't seem to be any that allow you to change an AV.

I've rewritten this reply 3 times now! Each time I had another idea, looked stuff up, started writing and then thought of something else. Rinse repeat!

Anyway, now I think that my idea would never really work, as the absorption effect runs on the player, not the incoming spell, so even if there was some way to trigger it only if the player was being attacked by elemental magic, the player would still have a chance of absorbing any other magic from other casters for as long as the ability was active. I think I just have to be content with adding a small boost to spell absorption and maybe a small boost to elemental resistances as well.

:)

Link to comment
Share on other sites

It's an interesting problem though,

How about this.

Duplicate perk WardAbsorb

Get rid of the two conditions to do with restoration.

Go into the perk entry, 'Modify ward magica absorb'

Click on conditions spell tab and add the conditions

S HasKeyword..........Keyword 'MagicDamageFire

S HasKeyword..........Keyword 'MagicDamageFrost

S HasKeyword..........Keyword 'MagicDamageShock

The same conditions you will find in the same place in the ElementalProtection perk

So now we have a perk that will offer 25% absorption from incoming Elemental spells WHEN the player is casting a ward.

Almost there if that works!

Next we set up a script so that when the player gets this perk they are casting a permanent ward BUT we make this ward a custom ward/spell that has no effects, no casting animation and no absorption value of its own. It doesn’t do a thing. Set every value in that spell to zero.

So now the perk gives the player a permanent ward that does nothing, except trigger the perk conditions, which are the effect your after. Theoretically!

The perk DA04BloodHarvestPerk has a script attached to it so it can be done. The problem is the trigger. There are none for perks. However we get around that with the constant ward/spell.

Scriptname DruidShield Extends Perk Hidden

should work as a header.

Then look at

http://www.creationkit.com/RemoteCast_-_Spell

This function casts the spell instantaneously. This is mainly desirable only for non-actors, because it will not animate an actor. For instance, the spell will be cast even if the actor's hands are not readied.

Which sound like what you need., Of course

http://www.creationkit.com/Cast_-_Spell

Should work if the custom spell actually does nothing.

Yes, the perk is going to run into trouble with any dispel magic effects, but that's a problem for later, and Bretons.

Not so much a back door around your problem dude, as a loose cat flap, but may be worth a go.

Link to comment
Share on other sites

OK, interesting, interesting - thanks for not giving up! In the end it's kind of minor because so much of the magic that gets thrown at you is elemental, but for the purposes of the perk I'm trying to make, it's the principle of the thing and I'd love to get it right.

Something I saw in the CK in Magic Effect is something called 'Equip Ability'. What if I make the invisible ward an ability that gets equipped when I add the perk ability? In fact, the perk ability would only be there to equip the absorb ability, if it works as I hope...

I'll let you know how that turns out!

Link to comment
Share on other sites

Ok, that didn't work! It ended up being quite complicated with too many variables to figure out why not, but in the end I think changing a ward effect to constant rather than concentration won't work, but it has to be constant to be an ability.

So I'll try it your way now, the only thing is I keep getting an error when I try to add a script: "The extends script does not exist, please pick one that does". Do you know what that's about? A google search came up with nothing useful...

Link to comment
Share on other sites

You need to go sit through ESV: Skyrim School...Papyrus 101

Scripting is one of those thing where a little knowledge is a dangerous thing, It can make you forget the basics (It does me anyway!)

When you click add script to the perk (or anything), the add new scrip box is creating the header for you essentially. If you have a perk open and click add script it will autofill the extends for you and so on. You just right click on the script then and select 'edit source' to get into it. I was going to post a few pics of this but it's in all in the tutorial mentioned.

I know it's a grind but once you have the basics of scripting down, the rest is mostly cut and paste from the vanilla scripts. Go get a vanilla script working on your perk (even just a 'hello world' debug box that pops up when player gets perk) and then dive into the stuff your interested in.

Anyway, bite the bullet and start those scripting tuorials. in a few weeks time you'll be spinning off scripts that summon dedric lords to act as human(?) shields for your character.

KW

Link to comment
Share on other sites

  • 3 weeks later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...