Jump to content

Quick Questions, Quick Answers


Mattiewagg

Recommended Posts

  • Replies 2.6k
  • Created
  • Last Reply

Top Posters In This Topic

Just realized now I completely forgot to thank IsharaMeradin and Darkxenoth for their help last time, thank you so much - it works beautifully now!

 

I wrote myself into a scripting wall again, and have no idea what's going wrong this time. The script loads with no errors, but shows no evidence of executing ingame. I'm attempting to partially override an NPC's specific combat behavior by directly using a script. To simplify I want it to equip and cast certain combat spells at varying percentages of its health as the battle goes on. Fair warning the script is quite messy, so optimization help would be greatly appreciated.

 

 

 

Scriptname ReaperCombatScript extends ObjectReference
Actor Property akCaster Auto
Actor Property akTarget Auto
SPELL Property AvengersWrathSpell Auto
SPELL Property AvengersFreezeSpell Auto
SPELL Property AvengersSoulrendSpell Auto
Function Wait(float afSeconds) native global
float Function GetActorValuePercentage(string asValueName) native
float Function GetAVPercentage(string asValueName)
return GetActorValuePercentage(asValueName)
EndFunction
Function EquipSpell(Spell akSpell, int aiSource) native
Function Cast(ObjectReference akSource, ObjectReference akTarget = None) native
Event OnCombatStart(Actor akCaster, Actor akTarget)
float ReaperHealth = akCaster.GetAVPercentage("Health")
If akCaster.GetAVPercentage("Health")<0.8
akCaster.AddSpell(AvengersWrathSpell)
akCaster.EquipSpell(AvengersWrathSpell,1)
AvengersWrathSpell.cast(akTarget)
akCaster.RemoveSpell(AvengersWrathSpell)
Endif
If akCaster.GetAVPercentage("Health")<0.75
akCaster.EquipSpell(AvengersFreezeSpell,1)
AvengersFreezeSpell.cast(aktarget)
Utility.Wait(1.0)
akCaster.EquipSpell(AvengersSoulRendSpell,1)
AvengersSoulRendSpell.cast(akTarget)
Endif
If akCaster.GetAVPercentage("Health")<0.6
akCaster.EquipSpell(AvengersWrathSpell,1)
AvengersWrathSpell.cast(akTarget)
Endif
If akCaster.GetAVPercentage("Health")<0.5
akCaster.EquipSpell(AvengersFreezeSpell,1)
AvengersFreezeSpell.cast(akTarget)
Utility.Wait(1.0)
akCaster.EquipSpell(AvengersSoulRendSpell,1)
AvengersSoulRendSpell.cast(akTarget)
Endif
If akCaster.GetAVPercentage("Health")<0.4
akCaster.EquipSpell(AvengersWrathSpell,1)
AvengersWrathSpell.cast(akTarget)
Endif
If akCaster.GetAVPercentage("Health")<0.25
akCaster.EquipSpell(AvengersFreezespell,1)
AvengersFreezeSpell.cast(akTarget)
Utility.Wait(1.0)
akCaster.EquipSpell(AvengersSoulRendSpell,1)
AvengersSoulRendSpell.cast(akTarget)
Endif
EndEvent

*EDIT* - I forgot to add the addspell and removespell commands to every event. Is this necessary or not? The NPC has none of these spells normally equipped.
I'm wondering if elseif's could be used instead of them all being separate events? I'm also wondering if the script should be tied directly to a quest to have a better chance of it working, or if it can be attached directly the the NPC to override its combat style all the time? If this is too big a question to post here, notify me and I'll remove this post. Should any who can help wish it, proper credit will be given if this mod ever gets uploaded.
Edited by avenger404
Link to comment
Share on other sites

I feel like I shouldn't even be posting in here because I'm just that new to modding beyond your run-of-the-mill follower made from a quick tutorial, but how would you set a spell to be on a certain part of the body? I don't get how I would end up editing Candlelight to summon two of itself and have them appear as a kind of overlay for the eyes. If you want more clarification, I want to do the same as I mentioned before. If you've played the MMORPG Aion as an Asmodian, you should know what I mean. If not, having glowing eyes for a follower when he is in combat, just for that one follower, then they vanish when he is no longer in combat. I have the script to have them toggle on when in combat, and off when not, but I still don't know how to edit a spell beyond making it summon an ally (or two without using the perk; I figured out that much) or hit enemies and damage them. Help?

Link to comment
Share on other sites

I feel like I shouldn't even be posting in here because I'm just that new to modding beyond your run-of-the-mill follower made from a quick tutorial, but how would you set a spell to be on a certain part of the body? I don't get how I would end up editing Candlelight to summon two of itself and have them appear as a kind of overlay for the eyes. If you want more clarification, I want to do the same as I mentioned before. If you've played the MMORPG Aion as an Asmodian, you should know what I mean. If not, having glowing eyes for a follower when he is in combat, just for that one follower, then they vanish when he is no longer in combat. I have the script to have them toggle on when in combat, and off when not, but I still don't know how to edit a spell beyond making it summon an ally (or two without using the perk; I figured out that much) or hit enemies and damage them. Help?

 

A little clarification as to what you still need for your desired effect would be extremely helpful. Are you working on a companion NPC or a helper you summon via conjuration or some other spell? I'm also not sure what you mean where you need a spell to do damage?

Link to comment
Share on other sites

 

Just realized now I completely forgot to thank IsharaMeradin and Darkxenoth for their help last time, thank you so much - it works beautifully now!

 

I wrote myself into a scripting wall again, and have no idea what's going wrong this time. The script loads with no errors, but shows no evidence of executing ingame. I'm attempting to partially override an NPC's specific combat behavior by directly using a script. To simplify I want it to equip and cast certain combat spells at varying percentages of its health as the battle goes on. Fair warning the script is quite messy, so optimization help would be greatly appreciated.

 

 

 

Scriptname ReaperCombatScript extends ObjectReference
Actor Property akCaster Auto
Actor Property akTarget Auto
SPELL Property AvengersWrathSpell Auto
SPELL Property AvengersFreezeSpell Auto
SPELL Property AvengersSoulrendSpell Auto
Function Wait(float afSeconds) native global
float Function GetActorValuePercentage(string asValueName) native
float Function GetAVPercentage(string asValueName)
return GetActorValuePercentage(asValueName)
EndFunction
Function EquipSpell(Spell akSpell, int aiSource) native
Function Cast(ObjectReference akSource, ObjectReference akTarget = None) native
Event OnCombatStart(Actor akCaster, Actor akTarget)
float ReaperHealth = akCaster.GetAVPercentage("Health")
If akCaster.GetAVPercentage("Health")<0.8
akCaster.AddSpell(AvengersWrathSpell)
akCaster.EquipSpell(AvengersWrathSpell,1)
AvengersWrathSpell.cast(akTarget)
akCaster.RemoveSpell(AvengersWrathSpell)
Endif
If akCaster.GetAVPercentage("Health")<0.75
akCaster.EquipSpell(AvengersFreezeSpell,1)
AvengersFreezeSpell.cast(aktarget)
Utility.Wait(1.0)
akCaster.EquipSpell(AvengersSoulRendSpell,1)
AvengersSoulRendSpell.cast(akTarget)
Endif
If akCaster.GetAVPercentage("Health")<0.6
akCaster.EquipSpell(AvengersWrathSpell,1)
AvengersWrathSpell.cast(akTarget)
Endif
If akCaster.GetAVPercentage("Health")<0.5
akCaster.EquipSpell(AvengersFreezeSpell,1)
AvengersFreezeSpell.cast(akTarget)
Utility.Wait(1.0)
akCaster.EquipSpell(AvengersSoulRendSpell,1)
AvengersSoulRendSpell.cast(akTarget)
Endif
If akCaster.GetAVPercentage("Health")<0.4
akCaster.EquipSpell(AvengersWrathSpell,1)
AvengersWrathSpell.cast(akTarget)
Endif
If akCaster.GetAVPercentage("Health")<0.25
akCaster.EquipSpell(AvengersFreezespell,1)
AvengersFreezeSpell.cast(akTarget)
Utility.Wait(1.0)
akCaster.EquipSpell(AvengersSoulRendSpell,1)
AvengersSoulRendSpell.cast(akTarget)
Endif
EndEvent

*EDIT* - I forgot to add the addspell and removespell commands to every event. Is this necessary or not? The NPC has none of these spells normally equipped.
I'm wondering if elseif's could be used instead of them all being separate events? I'm also wondering if the script should be tied directly to a quest to have a better chance of it working, or if it can be attached directly the the NPC to override its combat style all the time? If this is too big a question to post here, notify me and I'll remove this post. Should any who can help wish it, proper credit will be given if this mod ever gets uploaded.

 

 

First of all, delete all those function definitions.

 

Second, delete the properties "akTarget" and "akCaster," because you are trying to use parameters with those same names and that will confuse your script.

 

Third, there is only one event as far as I can tell, so I'm not sure what you are referring to when you say "separate events."

 

Fourth, the event "OnCombatStart" does not appear to exist. Is this a custom event? If so, how are you triggering it?

 

There is no need to give an object a spell in order to have the object cast it. In fact you repeatedly give the spell to akCaster yet you have akTarget actually doing the casting.

Link to comment
Share on other sites

If I make a light armor, and set it with any of the "mage armor" keywords, will that allow it to work with the mage armor perks?

Or will it still count as wearing armor, and not allow the mage armor perk to activate?

 

Im making boots and gloves, and it makes sense for them to be a very light armor, and fits the visuals, as well. But I dont know if that will block the mage armor perks from working.

 

Thanks in advance for answers.

Link to comment
Share on other sites

If I make a light armor, and set it with any of the "mage armor" keywords, will that allow it to work with the mage armor perks?

Or will it still count as wearing armor, and not allow the mage armor perk to activate?

 

Im making boots and gloves, and it makes sense for them to be a very light armor, and fits the visuals, as well. But I dont know if that will block the mage armor perks from working.

 

Thanks in advance for answers.

 

The mage armor perk checks for the keywords ArmorLight and ArmorHeavy, so as long as your armor does not have either of those keywords you should get the bonus to mage armor. You can check for yourself by opening any of the "-flesh" spells and double-clicking the bonus effects to see what conditions they check for.

 

Assuming by "mage armor keywords" you mean the MagicArmor30Perk et al keywords, putting them on a piece of armor won't do anything at all. They are attached to the magic effects that grant the bonuses, not any pieces of armor. You can check what other forms reference a given form by right-clicking on it and selecting "Use Info." If you do that for the MagicArmor30Perk you will see that no armor references that keyword at all.

Link to comment
Share on other sites

I feel like I shouldn't even be posting in here because I'm just that new to modding beyond your run-of-the-mill follower made from a quick tutorial, but how would you set a spell to be on a certain part of the body? I don't get how I would end up editing Candlelight to summon two of itself and have them appear as a kind of overlay for the eyes. If you want more clarification, I want to do the same as I mentioned before. If you've played the MMORPG Aion as an Asmodian, you should know what I mean. If not, having glowing eyes for a follower when he is in combat, just for that one follower, then they vanish when he is no longer in combat. I have the script to have them toggle on when in combat, and off when not, but I still don't know how to edit a spell beyond making it summon an ally (or two without using the perk; I figured out that much) or hit enemies and damage them. Help?

You can tell you have no experience, so maybe try starting small? I will explain it one last time and if you still can't figure it out wait till you are more experienced. You need to make a custom .nif based of of any spell (my example was candlelight). Take the .nif and alter it so the affect of the spell is just a glowing light at eye height. Attach that .nif to a custom candle light in the CK and use the script i gave you.

Link to comment
Share on other sites

 

I feel like I shouldn't even be posting in here because I'm just that new to modding beyond your run-of-the-mill follower made from a quick tutorial, but how would you set a spell to be on a certain part of the body? I don't get how I would end up editing Candlelight to summon two of itself and have them appear as a kind of overlay for the eyes. If you want more clarification, I want to do the same as I mentioned before. If you've played the MMORPG Aion as an Asmodian, you should know what I mean. If not, having glowing eyes for a follower when he is in combat, just for that one follower, then they vanish when he is no longer in combat. I have the script to have them toggle on when in combat, and off when not, but I still don't know how to edit a spell beyond making it summon an ally (or two without using the perk; I figured out that much) or hit enemies and damage them. Help?

You can tell you have no experience, so maybe try starting small? I will explain it one last time and if you still can't figure it out wait till you are more experienced. You need to make a custom .nif based of of any spell (my example was candlelight). Take the .nif and alter it so the affect of the spell is just a glowing light at eye height. Attach that .nif to a custom candle light in the CK and use the script i gave you.

 

How would you go about editing/making the .nif? It would require Blender to edit and Nifskope to export it to an editable format, right?

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.

×
×
  • Create New...