Change soul gem capacity

Post » Tue Mar 01, 2011 5:23 pm

Well, I'm getting annoyed at accidentally "filling" grand soul gems with petty souls, while my Azura's star remains empty. I had the genius idea of adding 1 to the capacity of the star, then hit a wall when the CS gave me a dropdown menu with text options for capacity.

I'm guessing there's a way around that, using scripts, or something, perhaps not even touching the capacity, but I'm too green to know about it.

Essentially, I'd like the order of soul gems to go (from lowest to highest): Petty ... Grand, Azura's Star, Black.

Any help is appreciated.
User avatar
Georgine Lee
 
Posts: 3353
Joined: Wed Oct 04, 2006 11:50 am

Post » Tue Mar 01, 2011 5:51 pm

snip


If you don't mind using OBSE, how about a custom soul trap spell that uses GetActorSoulLevel to determine the soul type of the target creature, GetDead to check for the death of the target creature, GetItemCount to check for possession of the various empty soul gems, RemoveItem to remove the lowest capacity gem able to hold that soul type, and AddItem to add a filled version of the soul gem for that soul type. A scripted effect runs on the spell target for the duration of the spell, so if at any time during the duration of the spell the target dies, the gems would then be swapped. You'd need a check to limit this to happening once, but that's easy to do with a simple variable.

It'd be a bit tedious but actually very easy to write and definitely a worthwhile goal. You could design a custom set of intelligent rules for selecting a soul gem (in other words, use Azura's Star before wasting a grand soul gem, etc).

You could have a vendor sell the intelligent soul trap spell, or (preferably, I think) revise the default versions of the soul trap spells to use the scripted effect (making the change seamless to the player).

There are some good tutorials about scripted spells on the CS Wiki.

That help? ;)
User avatar
Anthony Rand
 
Posts: 3439
Joined: Wed May 09, 2007 5:02 am

Post » Tue Mar 01, 2011 9:11 pm

-Snip-


That helps me a bit. Would a scripted spell work be available for player enchanting? If not, then it would be a bad idea to replace the original soul trap.

Edit: I forgot to ask: Has anyone done this? Is anyone willing to provide a sample script?
User avatar
u gone see
 
Posts: 3388
Joined: Tue Oct 02, 2007 2:53 pm

Post » Wed Mar 02, 2011 6:58 am

scn TestSoulTraqeffectScriptshort SoulLevelBegin ScriptEffectFinish	If (GetDead)		let SoulLevel := GetActorSoulLevel		MessageBox "SoulLevel is %.0f" SoulLevel		; You could add code here to set a variable a variable in a quest script to SoulLevel and have it act accordingly.	EndIfEnd


Sample test is not something one would use, but it illustrates how simple this is.
User avatar
Andrew Lang
 
Posts: 3489
Joined: Thu Oct 11, 2007 8:50 pm

Post » Wed Mar 02, 2011 1:52 am

scn TestSoulTraqeffectScriptshort SoulLevelBegin ScriptEffectFinish	If (GetDead)		let SoulLevel := GetActorSoulLevel		MessageBox "SoulLevel is %.0f" SoulLevel		; You could add code here to set a variable a variable in a quest script to SoulLevel and have it act accordingly.	EndIfEnd


Sample test is not something one would use, but it illustrates how simple this is.
No quest scr necessary - add a script effect update in case the actor dies before the spell finishes
User avatar
Chase McAbee
 
Posts: 3315
Joined: Sat Sep 08, 2007 5:59 am

Post » Wed Mar 02, 2011 2:11 am

No quest scr necessary - add a script effect update in case the actor dies before the spell finishes


Would that be an issue if it the effect has a one second duration. In the case I am working with, this sword would not ever have this effect longer than one second. The idea, I am working with for my mod is that the player must get the killing blow...

With what you seem to be saying in mind, I am thinking if I did this:

scn TestSoulTraqeffectScriptshort SoulLevelBegin ScriptEffectUpdate	If (GetDead)		let SoulLevel := GetActorSoulLevel		; Do Stuff	EndIfEndBegin ScriptEffectFinish	If (GetDead)		let SoulLevel := GetActorSoulLevel		; Do Stuff	EndIfEnd


... isn't there a potential to "Do Stuff" twice?

Would this work better instead?

scn TestSoulTraqeffectScriptshort SoulLevelshort ActiveBegin ScriptEffectStart	set Active to 1EndBegin ScriptEffectUpdate	If (Active == 1)		If (GetDead)			let SoulLevel := GetActorSoulLevel			; Do Stuff			set Active to 0		Endif	EndIfEndBegin ScriptEffectFinish	If (Active == 1)		If (GetDead)			let SoulLevel := GetActorSoulLevel			; Do Stuff			set Active to 0		Endif	EndIfEnd


What I am not seeing here is the need for the ScriptEffectUpdate block. Wouldn't GetDead still return true even if the target has been dead for more than one second? How about 180 seconds as an example?

http://cs.elderscrolls.com/constwiki/index.php/GetDead#Notes state that you could call GetDead again and it would be true all the way up to just before it re-spawns. Or I am missing some not-so-obvious issue?

I am a bit curious about the workings of script effects. I can't seem to find much detail for the uninitiated. Are spell effects multiple instances of the same code, maintaining their own variables, etc? Let's say, for an example, that I had a long duration on the effect and I hit several different actors/creatures/mobs in quick succession. Then, somehow I pulled an Area Effect that killed them all, effectively, at the same time and before the duration is up. I know the core of the game processing must be handled in a linear fashion even if, by some chance, threads are returning results, but how could I be certain that they aren't stepping on each other or that, effectively, only one "soul trap" will ever succeed? I suppose I could go test it, thoroughly, but it would be nice to have detailed information, so I don't have to test my every concern. ...or find my self searching my code for a bug. This would not be an issue in my mod, but I had thought about setting up a similar sword for a companion and wondering if I needed a superstate script and/or enchantment for the other sword. Well, maybe it could be an issue if a user of my mod decided to console-add a second sword... Do you see my concern here?

Edit: Spelling
User avatar
Lucky Girl
 
Posts: 3486
Joined: Wed Jun 06, 2007 4:14 pm

Post » Wed Mar 02, 2011 3:16 am

No quest scr necessary - add a script effect update in case the actor dies before the spell finishes


Maybe you are right... I am using deadly reflexes and testing my sword enchanted with custom soul trap for 1 second. On a decapitation, I failed to capture the soul. Or maybe it has to do with what deadly reflexes does with decapitation.
User avatar
tiffany Royal
 
Posts: 3340
Joined: Mon Dec 25, 2006 1:48 pm

Post » Wed Mar 02, 2011 8:45 am

I have been digging and I don't see a way for the scripted spell to identify the caster. Is there something I am missing?

If I can't I identify the caster, then I will have to make it for player only. If NPC's can and do use soul trap then replacing the soul trap would add/remove soul gems from the player in place of the filling them. I don't know if AI is in place, even for companions, to use the soul trap spell. But let's say they get a weapon with soul trap on it and start using it. I can see a potential problem here.
User avatar
lucile
 
Posts: 3371
Joined: Thu Mar 22, 2007 4:37 pm


Return to IV - Oblivion