noob trying to figure out obse

Post » Mon Dec 12, 2011 11:56 pm

ok, so i have been using a mod that runs a script specifically looking to see if a player has certain items equipped, the problem is that once you enchant the item(s), then the script looks at it as you no longer equipping the item it is looking for....

so the question is, how do i adjust the script to look for the baseid (i think this doesnt change) of an item?


PS... if this post is in the wrong forum, please adjust accordingly
User avatar
Rachel Tyson
 
Posts: 3434
Joined: Sat Oct 07, 2006 4:42 pm

Post » Tue Dec 13, 2011 8:56 am

Might be better suited in the CS forum, but still, if you enchant an item actually a new base item is created. So this will not be of any help for this issue.

I don't know how to solve this issue, as my CloneForm approach in my race control scripts is underlying the same restrictions, breaking scripts checking for a certain BaseID to be equipped/worn.

If there was a simple way, preferably even getting away without having to change the checking scripts themselves, I'd literally die for knowing it.
User avatar
ashleigh bryden
 
Posts: 3446
Joined: Thu Jun 29, 2006 5:43 am

Post » Tue Dec 13, 2011 10:52 am

The only thought I have is the following, and it's totally theoretical.

1. Create an array_var of all the items you want to check against.
2. That array must be kept in a quest script so that it can be referred to globally, and so that the information saves with the game.
3. Items can have object scripts attached to them.
4. Create one object script that all of these items point to.
5. You will need two separate blocks, one "OnAdd" and one "OnEnchant"
6. When the player adds the item to their inventory, the OnAdd block adds the item ref to the global array for your other scripts to check against. It also saves the item ref to the object in a variable.
7. In the OnEnchant block, it compares looks at the ref and compares it to the original saved in the variable. If they are different, it saves the new ref over the old ref and then adds it to the global array.

Anyway, something like that might work. But I'm not an expert.
User avatar
Melis Hristina
 
Posts: 3509
Joined: Sat Jun 17, 2006 10:36 pm

Post » Tue Dec 13, 2011 3:54 am

I had an idea of using GetModelPath to recognize enchanted items, their model never changes.
User avatar
FITTAS
 
Posts: 3381
Joined: Sat Jan 13, 2007 4:53 pm

Post » Tue Dec 13, 2011 4:20 am

Yeah, but models can be used by different weapons.

You can use the function that gets you the last self-enchanted item like saebel says; that'll cover the in-game enchanting system. It won't work for script-based stuff, though, which is frustrating. I've had this same problem with ARES; if I ARES-ify something that a script references, it won't get it.

It'd be cool to like... alias objects as others. I wonder if that's possible...
User avatar
Austin England
 
Posts: 3528
Joined: Thu Oct 11, 2007 7:16 pm

Post » Tue Dec 13, 2011 8:25 am

So if I understand this correctly, when an object is enchanted, the reference ID actually changes? I guess that makes sense because under the hood it's actually a totally new object with new statistics, but it looks the same because it's pointing to common base features. Like variaitons on the same brass ring, each one is going to be unique, and when you enchant one, it's no longer what it was, so it needs a new ID to separate it from all the others.
User avatar
Hairul Hafis
 
Posts: 3516
Joined: Mon Oct 29, 2007 12:22 am


Return to IV - Oblivion