Soul Gems

Post » Fri May 27, 2011 8:40 pm

I'm kinda curious about the technicalities of soul gems in the game... When you look at it in a console, all it says is the gem type, and makes no reference at all to the soul (i.e. misc_soul_gem_grand_01 or something like that :) ), but when you use it, you get a soul. I know it must be hardcoded into the game, but... what is hardcoded into it? :?
User avatar
Cagla Cali
 
Posts: 3431
Joined: Tue Apr 10, 2007 8:36 am

Post » Fri May 27, 2011 5:51 pm

When you open a gem placed in the game world, there's a list option for extra data. If you check has soul and select a creature ID, it sticks the soul in the soul gem.

When you are scripting, you can make a check if ( player->hassoulgem "creature_ID" > 0 ) it will check if the player has one or more soul gems with that specific creature's soul in it. The drawback is it will only check for one specific creature ID, so if you want to check for all winged twilight types for example, you have to make checks for every kind, whether they're the basic kind, summoned, or named unique ones.
User avatar
Khamaji Taylor
 
Posts: 3437
Joined: Sun Jul 29, 2007 6:15 am

Post » Fri May 27, 2011 7:58 am

Just a quick question I wanted to post in here instead of starting a new topic. This one seemed most fitting.

Is there a way to add filled soulgems to a leveled item list or inventory? Say, a greater soul gem with a Flame Atronarch inside as loot from a monster?

Thanks.
User avatar
luke trodden
 
Posts: 3445
Joined: Sun Jun 24, 2007 12:48 am

Post » Fri May 27, 2011 10:14 pm

You use AddSoulGem instead of AddItem. From MWSFD:

AddSoulGem "creature ID" "soulgem ID"


As for leveled lists, I don't know of a way to do that, and I don't think there is one. It's easy to script in as above, but you can't really add a filled soul gem to the inventory of something else. As far as I know AddSoulGem only works with the player's inventory (but don't quote me on that, I could be wrong).
User avatar
Tasha Clifford
 
Posts: 3295
Joined: Fri Jul 21, 2006 7:08 am

Post » Fri May 27, 2011 4:20 pm

Seeing as you can only add soulgem templates to leveled lists in the CS and you can only assign souls to a specific instance, I'd say it's not possible in the CS. Since adding objects to lists through scripting is a Very Bad Thing, you shouldn't try it there either. It might be possible with MWEE or a low-level editor, but I'm not sure.
User avatar
maddison
 
Posts: 3498
Joined: Sat Mar 10, 2007 9:22 pm

Post » Fri May 27, 2011 9:08 am

Since adding objects to lists through scripting is a Very Bad Thing...

Why is that, anyway? I've heard people say this but can't seem to find an explanation why.
User avatar
Tiffany Castillo
 
Posts: 3429
Joined: Mon Oct 22, 2007 7:09 am

Post » Fri May 27, 2011 2:04 pm


Since adding objects to lists through scripting is a Very Bad Thing...


Why is that, anyway? I've heard people say this but can't seem to find an explanation why.


The scripting functions to do so were introduced with Tribunal, but people had discovered the need for (and created tools to perform) levelled list merging and sorting before Tribunal came out. When these functions are used, the levelled list so generated is stored in the savegame and breaks levelled list merging. Now if all mods that ever used levelled lists used these functions, there wouldn't be a problem - except that they wouldn't work for people who didn't have Tribunal.

And So The Levelled List Functions were declared a Very Bad Thing not to be used in public; you should only ever use them on a levelled list that is unique to your mod and you can guarantee that nobody else will modify. What you can do is add a function-managed list as a nested member of a merge-managed list; but be very careful in doing so.

Adding a filled soulgem in such a way will probably cause a CTD :shrug:
User avatar
Lovingly
 
Posts: 3414
Joined: Fri Sep 15, 2006 6:36 am

Post » Fri May 27, 2011 3:27 pm

You use AddSoulGem instead of AddItem. From MWSFD:

AddSoulGem "creature ID" "soulgem ID"


As for leveled lists, I don't know of a way to do that, and I don't think there is one. It's easy to script in as above, but you can't really add a filled soul gem to the inventory of something else. As far as I know AddSoulGem only works with the player's inventory (but don't quote me on that, I could be wrong).

Add some placeholder items into the CS. For example, a misc item with the inventory icon and world model of a grand soul gem. Give it a unique ID and name it "Grand Soul Gem (Golden Saint)".

Add it to your leveled list. People can then used leveled list mergers as required. You might need to make sure that only one can be added to a single container. You'll need to test that.

Add a script to the item to check if it's in the players inventory and if so, start a second script if the second script is not already running. The second script should remove the placeholder item, add the correct item ( AddSoulGem Misc_SoulGem_Grand "golden saint" ), and then exit.
User avatar
Oceavision
 
Posts: 3414
Joined: Thu May 03, 2007 10:52 am


Return to III - Morrowind