Getting references of items in your inventory.

Post » Thu Apr 08, 2010 4:55 pm

You're not trying to run the setnameex on the reference to the cloneform, are you?


Um yes I am and I got it working, the only problem was that I used n% instead of %n. I found a obse plugin free workaround to Leviathans trophy soulgems, so you get a unique soulgem with the creatures name if you use the custom spell on it. I know, extensive use of cloneform, but there is no other way either, atleast no extra plugins are needed. Just clean the saves with Wrye once in a while or do a clean save and it'll be fine...or simply don't use it :P
User avatar
James Potter
 
Posts: 3418
Joined: Sat Jul 07, 2007 11:40 am

Post » Thu Apr 08, 2010 7:02 pm

It seems that showler's new suggestion is a good one as it solves the problem right at the source. I am not familiar with spells to say whether it can be done or not.

In case that does not work for some reason, I've found that GetCurrentSoulLevel in the soulgem script does return the correct soul level, even while the soulgem is in inventory, therefore "If GetCurrentSoulLevel == 1" (without a reference) will work OK.

Problem is getting the info out of the soulgem script.
When there are more than one item from the same Base Object, RemoveMe does not necessarily remove the soulgem where the script is running. Most likely it will remove a different one, which messes things up. Same goes for DropMe.

Here goes another complex, crazy idea: the soulgems are scripted to:
1) Get a unique 'ID' from a quest script. The ID is an integer that starts with 0 and the soulgem script picks it as its ID and adds 1 to the value, so the next one will get the next ID.
2) When a certain quest variable is set to 1, the soulgem script uses a GetCurrentSoulLevel and saves the soul level info on a quest map array, using its ID as key and the soul level as value. Pretty much saying "Hey, I am soulgem #284 and my current soul level is 3"

When you want to replace the soulgems, you clear the map array, set that quest variable to 1, wait a couple of frames for the soulgems to update their state, return the quest variable to 0, totalize the number of current soul levels, remove all soulgems and add the calculated number of the proper soulgems.

(I am unig this ID trick to identify generic items for my bloat test and it works fine)


OTOH, from your example, I wonder if you actually need to know the current soul level.

If your objective is refill the soulgems in inventory to their max capacity, you could do that with the info from the base object.

If this is the case, you could walk the soulgems in inventory, use GetSoulGemCapacity (on the base record ref) to determine the number and type of each soulgem, remove them with RemoveItem and replace them with AddItem .
User avatar
Elle H
 
Posts: 3407
Joined: Sun Aug 06, 2006 3:15 am

Post » Thu Apr 08, 2010 4:59 am

Well, the original purpose of all this was to make player filled soul gems compatible with a variety of mods that check for filled soul gems in the Player's inventory. Because of the same limitations we've been trying to theorize our way around, those mods inevitably end up requiring pre-filled gems that can be properly tested.

In that case, you'd want the gems to be filled with an equivalent type of gem and equivalent soul level inside them to keep things fair. That part is the easy part if the detection can be done correctly.

Seems like Dominick has also found a way to make a version of Trophy Soul Gems without the dependency on Pluggy or Refstuff that the original has. Which would also be awesome.
User avatar
Nancy RIP
 
Posts: 3519
Joined: Mon Jan 29, 2007 5:42 am

Post » Thu Apr 08, 2010 7:33 am

I know cloneform bloats saves but how much exactly? What is the use threshold for it to add 200 kb to a save for example? People didn't seem to complain much about the original, but it used cloneforms without cleaning too, so am I just overthinking or is this a reasonable concern? :) And I tried getting the soul levels of player filled soulgems with getcrosshairref too, it still returns it as empty! How is it possible to detect the soul levels of those gems at all if they return empty on filled specific references too?
User avatar
Rusty Billiot
 
Posts: 3431
Joined: Sat Sep 22, 2007 10:22 pm

Post » Thu Apr 08, 2010 5:54 pm

Cloneforms and savegame bloat are indeed a concern. Just how much of one? Well... that really depends on just how often you use it, and if you use any 'cleanup' methods along with it. I used cloneforms in one of my versions of the Crossbows of Cyrodiil scripts, and did not really notice bloating. but then, crossbows weren't quite as popular as soul gems either.

If you can find a way to clean up the unneeded clones, it really shouldn't be a problem.
User avatar
Lily Something
 
Posts: 3327
Joined: Thu Jun 15, 2006 12:21 pm

Post » Thu Apr 08, 2010 6:52 pm

If you are only cloneforming with a specific spell to make a "Trophy Soul Gem", I doubt there are enough unique creatures in the game to make bloat a worry.

You're only concern would be obsessive compulsive players who try to collect every soul in the world, unique or not.
User avatar
Lady Shocka
 
Posts: 3452
Joined: Mon Aug 21, 2006 10:59 pm

Post » Thu Apr 08, 2010 6:13 pm

If you are only cloneforming with a specific spell to make a "Trophy Soul Gem", I doubt there are enough unique creatures in the game to make bloat a worry.

You're only concern would be obsessive compulsive players who try to collect every soul in the world, unique or not.


Hehe, well that's their problem, I'm sure they can handle a +10 mb growth in save files if they are happy with their accomplishments. Actually the way it's set up now is that if you capture a soul of a wolf and then another wolf of the same base object, it creates new cloneforms for both of them, since I can't really make the spell use the clone that was already created from this creature's base form without making premade trophy soulgems for all of the base creatures, and that is just a silly amount of work, not to mention incompatible with custom creatures. But I think wrye bash will clear unused clone base objects up pretty well (I'm probably mistaken though). How would I use a clean command on trophy soulgems that have been used anyway? I know refstuff has an experimental deletecloneform command (even though I dislike additional requirements to my mods) No way to get their references anymore. :huh: If there are any modders who have good equipment to make bloat checks, I'm happy to send it to you. I know Qquix has some impressive setups for this purpose. :angel: He always has fun stuff at the wormhole :rock:
User avatar
trisha punch
 
Posts: 3410
Joined: Thu Jul 13, 2006 5:38 am

Post » Thu Apr 08, 2010 3:28 pm

OBSE also has a http://cs.gamesas.com/constwiki/index.php/DeleteReference function. I think it works on clone forms.......
User avatar
Lizbeth Ruiz
 
Posts: 3358
Joined: Fri Aug 24, 2007 1:35 pm

Post » Thu Apr 08, 2010 6:23 pm

OBSE also has a http://cs.gamesas.com/constwiki/index.php/DeleteReference function. I think it works on clone forms.......
http://www.gamesas.com/index.php?/topic/1082422-beta-oblivion-script-extender-obse-0018/page__view__findpost__p__15799814

Seems not to work on cloneforms, apparently.
User avatar
joannARRGH
 
Posts: 3431
Joined: Mon Mar 05, 2007 6:09 am

Post » Thu Apr 08, 2010 9:51 am

Okay, good news...well not about getting specific references of things in your inventory, but atleast I figured out how to harmlessly turn player filled soulgems into prefilled soulgems, that register like they should and have the proper values and icons(an issue if a soulgem replacer is used). I already tried this method without success, but now I rewrote it as a quest form that runs only when you drop a soulgem. Atleast it doesn't need additional obse plugins (I wish they would incorporate all the plugins into obse itself) So you drop soulgems with a soul that you captured, one at a time, they briefly flash infront of your eyes, because the getcrosshairref already manages to register and activate the script. When the original ref has been confirmed as deleted, you get the message "This filled soulgem is acceptable" or no message at all. I know it can get slightly tedious if you have many personally filled soulgems, but I find it's worth it, it's good practice for one to check one's work ;) Just so it's available if anyone is interested :)

Edit: I could remove the tediousness with getrefcount however. :)
User avatar
Hearts
 
Posts: 3306
Joined: Sat Oct 20, 2007 1:26 am

Previous

Return to IV - Oblivion