Jump to content

[LE] Contextual Magic Effects using Spell Conditions help plz


baldy3456

Recommended Posts

Hello! I am looking for any advice on spell conditions and getting conditional effects similar to the Spell Siphon mod. I am fairly new to using the creation kit and I know this is pretty advanced stuff but I figured if I could start a proof of concept I could drum up interest in this Mod Idea for someone more experienced.

I am working on a mod to condense many of the spells into a smaller list of Aimed Concentration spells that are contextual to payer state and target and evolve with perks added by reading tomes. The base concept came from the Spell Siphon mod with the Concentrated (or Shield) Light spell that changes to a ward when the player enters combat. It really frees up quick select buttons by grouping spells by their use and context. (I am aware they actually force a spell equip and a recast on some effects)

An example of something that I almost have working is a Necromancy Conjuration spell that starts as a weak absorb Health Stamina and Magica that can soul trap living NPCs and also resurrects dead NPCs and Heals and Buffs them. All of the all of the tertiary effects will be activated in the spell by perks awarded by reading the corresponding spell tomes.

All of this hinges on some way to turn effects on and off based on conditions... It think. That is at least what I thought after doing a lot of research. I know I will have to get into scripting and I have already started working on it with the Reanimation portion of the conjuration spell.

To start on a very simple footing I am trying to get a test Concentrated Aimed spell that casts flames by default shock when sneaking and frost when aiming at a dead NPC. I set the spell conditions for the fire to (Condition Function "IsSneaking" == 0.00 to run on Player) for Shock (Condition Function "IsSneaking" == 1.00 to run on Player) and for Frost (Condition Function "GetDead" == 1.00 to run on Target).

The base spell works with flames but Sneaking does not switch to or add shock and targeting a dead NPC does not switch to or add frost. I know I am missing something fundamental here but I can't find out what it is.
I am getting a warning saying "Failed to get owner quest for unowned conditions" I am unsure what that means exactly. Any help would be appreciated.

PS. If anyone is interested in getting involved on the technical side I have a design draft of almost every spell and how they would work in game. I am willing to integrate input or ideas and have no problem sharing credit or even just being a contributor. If you have skills and are interested let me know and I can elaborate on what I have planned and we can get in contact.

Link to comment
Share on other sites

Hey, so the art that spells use are based on the spells most powerful magic effect, and you can't change it with conditions unfortunately. So, you're best bet is to use an ability with different magic effects with conditions and then use a script with OnEffectStart to equip different spells.

Link to comment
Share on other sites

Thanks dylbill!

I was starting to understand that my self as I tinkered with it. This is exactly how the Spell Siphon mod Works which I glossed over stupidly. I have been having an issue finding reference for a function that forces the player to equip a spell on the Creation Kit web site.

Link to comment
Share on other sites

Thanks again.

So I am switching gears from testing on test effects to the ones I really want. I have a custom copy Base Concentrated Aimed fire spell and I made a custom Ability with a custom scripted magic effect. the fire spell applies that ability. The ability will detect if the player is sneaking or dual casting and force an equip of specific spells. (Fire Ball for Dual casting Fire Rune for Sneaking)

I have my script started with exposed properties for the two spells I am trying to equip and the caster who I will set Caster = Game.GetPlayer(). I have some variables called out which are: bool bSneaking = False,

bool bDualCasting = False.

I am unsure if I am supposed to use Event OnEffectStart. This is a script that will be running for as long as the spell is equipped. (Im not sure if this is bad practice). I do know that I will need to have event end if sneaking is false and end if dual casting is false. I know I will need to run an equipspell function if either are true. I am not sure if my properties are set up correctly so I can call each spell to I am equipping individually (Do they need unique names in the properties?).

I think I need to make a check for if I have a spell equipped and what spell that is and make a variable to specify to only replace a the specified spell (light or left hand equip).

I am a little frozen to start the Event section of the script as I am still very new to this. Here is what I have so far.

;======================================================================================;
; PROPERTIES /
;=============/
Spell property SpellRef auto
{The name of the Stealth spell to swap to. (REQUIRED!)}
Spell property SpellRef auto
{The name of the Dual Cast spell to swap to. (REQUIRED!)}
Actor Property Caster Auto
;======================================================================================;
; VARIABLES /
;=============/
bool bSneaking = False
bool bDualCasting = False
;======================================================================================;
; EVENTS /
;=============/
Edited by baldy3456
Link to comment
Share on other sites

You need to name your SpellRef something different, it can't be a property twice. Here is how I would do it.

 

For your ability, make a separate magic effect for each condition you want to use. In your ability spell, add multiple magic effects and put the conditions on the magic effects in the spell in the creation kit. So one magic effect on the spell has the condition IsSneaking == 1. Another magic effect has the condition IsSneaking == 0. Then you can a script with OnEffectStart to equip the spell you want. Those effects will become active when the conditions are true. You can put the same script on each magic effect if you want. The script would look something like:

 

Scriptname TM_ForceEquipSpell extends ActiveMagicEffect 
;For example, put the condition IsSneaking == 0 on this spell's magic effect 

Spell Property SpellToCheck Auto ;the spell to replace with force equip
Spell Property SpellToEquip Auto 

Event OnEffectStart(Actor akTarget, Actor akCaster)
    Spell RightSpell = akTarget.GetEquippedSpell(1)
    Spell LeftSpell = akTarget.GetEquippedSpell(0)
    
    If RightSpell == SpellToCheck 
        akTarget.EquipSpell(SpellToEquip, 1) ;equip spell in right hand
    Endif 
    
    If LeftSpell == SpellToCheck 
        akTarget.EquipSpell(SpellToEquip, 0) ;equip spell in left hand
    Endif 
    
EndEvent
Link to comment
Share on other sites

Thanks you soooo much dylbill!

This all makes a lot more sense to me now. With the properties I was unsure if I could change the "SpellRef" portion of that line. It seems like "Spell Property" is what exposes that in the property window for the script. Still unsure what the "Auto" means.

 

The sneaking seems like it will be the more strait forward condition as that is a Boolean state. I am having issues finding scripting references that detect the moment a spell is being dual cast. ( Right and Left hand equipped with the same spell triggered at the same time) If I do find that reference would that play out the same? It may be awkward as it may force the player to recast after the new fire ball spell is equipped. I may have to settle on detecting if both hands have the same spell equipped which is not quite what I had in mind.

I do have plans to change spells based on right hand left hand combos which would use a similar system that detects what spells are equipped and changes some of the spells to unique variants. An example of this would be a Ward spell will cast Fire cloak if fire spell is equipped and Fire cloak is unlocked. The general point is to remove the need to interact with menus at all during combat and make magic a little more explorative.

Thanks again so much for helping me work my way through this. I am a game artist professionally and this is all adjacent to my work but I am not very skilled with scripting, especially in this engine. I have plans to add all of the Lesser Daedra with custom art (Which is my actual skill set) The system I have in mind for Daedra Summoning hinges a lot on this "Combo" Concept so the player can cycle through different summons mid battle without opening a menu. (Fire spell + Daedra Summon = Flame Atronach) Here is an example of some of my work on other mod projects: https://www.nexusmods.com/skyrim/images/713397

Link to comment
Share on other sites

Woa nice!! I'm the opposite, I don't know much about modeling or texturing art stuff, but am pretty comfortable with scripting. It's just a hobby, but I've gotten pretty good at it over the years. If you want to read more about properties you can here: http://tesalliance.org/forums/index.php?/topic/5039-class-2-properties/

 

The creation kit condition for duel casting is IsDualCasting. Here's a list of conditions functions: https://www.creationkit.com/index.php?title=Condition_Functions

You're right though, having to recast would be awkward, so just checking if the spell is in both hands might be the way to go.

 

If you want an example of using an ability with conditions to do stuff, you can check out my mod Interior Vs Exterior Brightness Settings: https://www.nexusmods.com/skyrimspecialedition/mods/34760. It's pretty basic, there's two magic effects on the ability. One has IsInInterior == 1, the other IsInInterior == 0 and set's the brightness with OnEffectStart.

Link to comment
Share on other sites

Thanks! I got to check out your mods.

Many of them seem like great changes to the game. I think I am going to use your encumbrance mod as it makes a lot of sense and functions like Fallout if I am not mistaken. I really appreciate Quality of Life mods. They tent to have a huge impact while playing.

In response to using Radial menus. While I like that better than the Favorites menu I started this mod from a similar viewpoint of the Spell Siphon mod. Playing with magic and manually picking my next spell always bugged me a little. There is something special about Spell Siphon that made magic feel complex and dangerous. I am trying to capture that but avoid some of the confusion and lore bending they had there. (I am a controller user for Skyrim so many menu mods don't cut it for me) I cant remember the name of the mod off the top of my head but there is a mod that allows up to 8 quick select button combinations for the controller and I like using that.

The goal of this mod is to boil the base set of default spells down to 10 equippable spells. Necromancy, Daedra Summoning, Bound Weapons, Fire, Ice, Lightning, Poison, Illusion, Alteration, and Restoration. I would shift some things around like Wards go into Alteration (Literally taught to the player by Alteration Master). I want to give each spell offensive capabilities so players can specialize entirely if they want without hiding in a corner for fights. I want to replace all spell tomes with New Books that bring up a menu to either give the Base spell (Default Behavior) or Bind the spell to its respective Architype spell. Also the player wont eat the Book anymore. Instead I intend to make custom covers for each Base game spell tome and the tome will persist and always bring up that menu so the player can unbind the spell and use default behavior whenever they want.

Some of this is just quality of life like Necromancy is a Concentrated Aimed Absorb Health, Magica, and Stamina, and soul traps living enemies and reanimates, heals, and buffs dead thralls. This full spell is only unlocked with all of the Tomes read and bound.

Others like Conjure Daedra are more interesting effects. I intend to have this spell summon a portal to a Daedric Realm (Rune or Fire Wall like Behavior with Concentration casting to keep it up) This portal will damage health and magica in an area and summon specific Daedra based on the other equipped spell Combo and heal and Buff those Daedra. I also plan to have a Base (No Combo) summon that can be changed using Tomes. ei Player starts with a scamp can replace with Dremora or Daedroth. Each Spell will be changed by the base Perk Tree Novice to Master. So You start with one weak scamp and end with several strong ones or alternatively One weak Dremora and end with 3 Dremora Lords. So with 8 of these 10 spells in the quick select the player will be able to summon up to 8 different Daedra while still having two offensive or defensive spells equipped. If I expand that to add sneaking and dual cast conditions that goes up to 24 types (Not sure if I want to commit to that many though).

This all seems pretty complex but it is based off the same mechanics mostly. After I get this base mode change and conditional stuff working I can propagate it to all of these concepts. This will take a while I imagine but it looks like I may be getting some scripting help from someone who is familiar with Modding Skyrim (Sister's Boyfriend engineer). If you know of anyone interested in something like this I could always use the help on the tech and implementation side. I can then better focus on the art and design side of it.

Link to comment
Share on other sites

  • Recently Browsing   0 members

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