Jump to content

Photo

How to get Object ID for Player Made Potions?

object id id formid potions item id mod

  • Please log in to reply
31 replies to this topic

#1
DavidSkx

DavidSkx

    Regular

  • Members
  • PipPip
  • 77 posts

I'm using the mod 'FormID Finder', and I'm trying to obtain the object ID of player made potions, for instance, Restore Health. I've noticed that every time I start a new game, the object ID for a potion I created is a different ID each time. So I'm guessing that because the custom potion isn't in the game yet, Oblivion has to generate an ID each time?

 

Does a hardcoded ID even exist for player made potions?



#2
KatsAwful

KatsAwful

    Enthusiast

  • Supporter
  • PipPip
  • 136 posts

This info is saved to your save file and generated on the fly. They are not exposed to the player as you'd expect. Hard coded object IDs are not used in order to not cause bloat and keep unique items unique

What do you need to do? You can always just walk through whatever inventory/crosshair reference and get the info you need. Check out "inventory references" for that



#3
DavidSkx

DavidSkx

    Regular

  • Members
  • PipPip
  • 77 posts

This info is saved to your save file and generated on the fly. They are not exposed to the player as you'd expect. Hard coded object IDs are not used in order to not cause bloat and keep unique items unique

What do you need to do? You can always just walk through whatever inventory/crosshair reference and get the info you need. Check out "inventory references" for that

 

I'm using HUD Status Bars, and I'm trying to calculate the total Health Potions that the player has, including custom ones. Problem is, I have to create a Restore Health Potion in order to get the Object ID from it so that my equation will work. I would like it to calculate on the fly without have to do that.


Edited by DavidSkx, 22 September 2020 - 03:11 PM.


#4
Striker879

Striker879

    YAOF ... just what the world needed

  • Premium Member
  • 10,998 posts

Thanks to Kats I remembered where I'd seen info regarding custom spell IDs, and I just did a test and the custom potion IDs can be discovered the same way.

 

So the steps for the spell IDs is this (from the UESP Wiki page Oblivion:Spells ... look down at the bottom of that page):

 

Spoiler
 
Not sure if this info will be of the helping you sort, or clouding the issue with irrelevant info variety,
 
- Edit - I spoilered up the irrelevant info ... feel free to snip in your quote. Sorry for the interruption.


#5
DavidSkx

DavidSkx

    Regular

  • Members
  • PipPip
  • 77 posts

 

Thanks to Kats I remembered where I'd seen info regarding custom spell IDs, and I just did a test and the custom potion IDs can be discovered the same way.

 

So the steps for the spell IDs is this (from the UESP Wiki page Oblivion:Spells ... look down at the bottom of that page):

 

 

 

Adding and Removing Spells
 
Adding spells
Spells can be added via the console using the player.addspell command, followed by its Form ID. For example, player.addspell 000A9822 would add Heal Major Wounds to the list of known spells. The command PlayerSpellBook or psb will add every spell defined in the game, including those from mods, test spells, and others not normally accessible to the player. Due to the amount of spells added this can have an adverse effect on game performance when accessing the spell list. Not all spells unlocked through this command will work, and some will not work as expected.
 
Removing spells
The game does not feature any way to remove a known spell except for using the command player.removespell followed by the spell's Form ID, e.g. player.removespell 000A97CA would remove the spell Calming Touch from the list of known spells. This method does not allow you to use the spell's name again for custom spells; the game will simply act as if a spell of the same name still exists.
 
The game uses the default starting spell Heal Minor Wounds as a fallback when casting a scroll spell, and therefore it is not recommended to remove it using any method.
 
Several modifications can be used to rename and remove spells: Wrye Bash allows you to both rename and delete spells. There is also an OBSE-based mod which allows you to remove spells while in game. If you don't want to or are unable to use either of these, then your only choice is the console. A recent version of COBL allows for spells to be deleted too.
 
Finding Form IDs for custom spells
Removing custom spells is complicated by the fact that they do not have a known Form ID. Their IDs can be found with following steps:
 
Create a custom save in-game by using the console command save <filename> 1 (the filename can be anything)
Look in the save game directory (Default: \My Documents\My Games\Oblivion\Saves) and look for <filename>.ess.txt
In this text file, search for "SPELs". Custom spells will be listed in a section that such as this:
 SPELs:
   FF00470B   108 00000000  0 Custom Spell                      -
   FF00470D   103 00000000  0 Unwanted Custom Spell             -
   (...)
 
 
 
The console command to create the custom save needs that one (1) at the end to create the text file ... and for me at least it took quite a while to create the text file (probably 30 or more seconds ... thought I'd locked things up in the game). Scroll down in the text file to the section with the heading ALCHs. Here's a copy/paste of the beginning of my own list (my guy does create a lot of custom potions ... note where there are multiple entries it's because he has some older, weaker versions that share the same name):
 

ALCHs:
 
  FF064E59   291 00000000  0 A Fortified Shielded Restore Magicka    - 
  FF028563   286 00000000  0 A Flaming Dead Burden                   - 
  FF0156F6   280 00000000  0 A Smart Fortify Willpower               - 
  FF0156F5   280 00000000  0 A Smart Fortify Willpower               - 
  FF1C030F   275 00000000  0 A Magician's Saviour                    - 
  FF067C87   274 00000000  0 A Magician's Helper                     - 
  FF0146F0   272 00000000  0 A Smart Willpower                       - 
  FF067C7D   272 00000000  0 A Total Grounding                       - 
  FF102D49   252 00000000  0 An Unhealthy Damage Fatigue             - 
  FF05DE1E   252 00000000  0 An Unhealthy Damage Fatigue             - 
  FF073699   251 00000000  0 A Fatigued Damage Strength              - 
  FF042C20   248 00000000  0 A Silent Damage Fatigue                 - 
  FF06E119   246 00000000  0 A Stiff Damage Health                   - 
  FF09643D   245 00000000  0 A Weakened Endurance                    - 
  FF051822   245 00000000  0 An Unhealthy Fatigue                    - 
  FF07B5F1   245 00000000  0 A Weakened Endurance                    - 
  FF03B775   242 00000000  0 A Fortified Restore Magicka             - 
  FF09E55A   242 00000000  0 A Fortified Restore Magicka             - 
  FF06A15A   241 00000000  0 A Shielded Restore Magicka              - 
  FF030C84   241 00000000  0 A Shielded Restore Magicka              - 
  FF01B23C   241 00000000  0 A Shielded Restore Magicka              - 
  FF01B23B   241 00000000  0 A Shielded Restore Magicka              - 
  FF015076   241 00000000  0 A Shielded Restore Magicka              - 
  FF013490   241 00000000  0 A Shielded Restore Magicka              - 
  FF013491   241 00000000  0 A Shielded Restore Magicka              - 
  FF0198A8   241 00000000  0 A Shielded Restore Magicka              - 
  FF01FE86   241 00000000  0 A Shielded Restore Magicka              - 
  FF0060EA   227 00000000  0 A Life Saver                            - 
  FF004C83   227 00000000  0 A Life Saver                            - 
  FF004C84   227 00000000  0 A Life Saver                            - 
  FF006B33   227 00000000  0 A Life Saver                            - 
  FF008432   227 00000000  0 A Life Saver                            - 
  FF009AF8   227 00000000  0 A Life Saver                            - 
  FF013AAC   227 00000000  0 A Life Saver                            - 
  FF0198A5   227 00000000  0 A Life Saver                            - 
  FF060160   227 00000000  0 A Life Saver                            - 
  FF067C7E   226 00000000  0 A Grounding                             - 
 
What I'm not clear on is normally an FF indicates the referenceID of something generated from a leveled list (bandits, creatures etc), so to remove the potion do you use the FF number (normally removeitem requires the baseID).
 
Not sure if this info will be of the helping you sort, or clouding the issue with irrelevant info variety,

 

 

This has indeed clouded the issue, sir.


Edited by DavidSkx, 22 September 2020 - 03:44 PM.


#6
Striker879

Striker879

    YAOF ... just what the world needed

  • Premium Member
  • 10,998 posts


 



 

Thanks to Kats I remembered where I'd seen info regarding custom spell IDs, and I just did a test and the custom potion IDs can be discovered the same way.

 

~ snip ~


 
Not sure if this info will be of the helping you sort, or clouding the issue with irrelevant info variety,

 

 

This has indeed clouded the issue, sir.

 

 

Sorry ... it is one of my specialities.



#7
KatsAwful

KatsAwful

    Enthusiast

  • Supporter
  • PipPip
  • 136 posts

Can't you just walk through the players inventory using inventory references, find the potions with restore health and update your flag? That's what I would do, something like this:

ref playerinv
ref inv
int count ; this is how you update your flag
let playerinv := PlayerREF
begin "whatever mode, i'd put it in a function to be called"

foreach iter <- playerinv
  if MagicItemHasEffect REHE iter == 1
    let count += 1
  endif
loop

Would have to expand it probably, but you never need the object ID of the custom potion, you only need to info from it instead. You'll probably also need to find out the count of the same potions the player has created, it'll only find unique inventory references. I've used this to store potions and ingredients the player has to a container, since we are processing inventory references we can address all of the unique items stored (including stolen). I can show you the script its attached to if you need something more complete



#8
DavidSkx

DavidSkx

    Regular

  • Members
  • PipPip
  • 77 posts

Can't you just walk through the players inventory using inventory references, find the potions with restore health and update your flag? That's what I would do, something like this:

ref playerinv
ref inv
int count ; this is how you update your flag
let playerinv := PlayerREF
begin "whatever mode, i'd put it in a function to be called"

foreach iter <- playerinv
  if MagicItemHasEffect REHE iter == 1
    let count += 1
  endif
loop

Would have to expand it probably, but you never need the object ID of the custom potion, you only need to info from it instead. You'll probably also need to find out the count of the same potions the player has created, it'll only find unique inventory references. I've used this to store potions and ingredients the player has to a container, since we are processing inventory references we can address all of the unique items stored (including stolen). I can show you the script its attached to if you need something more complete

 

I'm working with the HUD Status Bars.ini file. This is what my equation looks like for calculating Potion of Healing (Weak, Normal, Strong, Player Made):

 

set tnoHSB.hud_val to sv_Construct  "(Player.GetItemCount 00009310) + (Player.GetitemCount 00098496) + (Player.GetItemCount 00009311) + (Player.GetItemCount CUSTOM POTION OBJECT ID HERE)"


Edited by DavidSkx, 22 September 2020 - 04:16 PM.


#9
KatsAwful

KatsAwful

    Enthusiast

  • Supporter
  • PipPip
  • 136 posts

You'd have to use a script in this case unfortunately. Even if you get the custom ID, it would only be one of them. Every different restore health spell would create a different ID thus making your formula incomplete



#10
DavidSkx

DavidSkx

    Regular

  • Members
  • PipPip
  • 77 posts

You'd have to use a script in this case unfortunately. Even if you get the custom ID, it would only be one of them. Every different restore health spell would create a different ID thus making your formula incomplete

 

Hmm, i haven't tried the function 'MagicitemHasEffect' in my equation. Would that work? As soon as I get home, I'll try it out. Thanks for all your help.







Also tagged with one or more of these keywords: object id, id, formid, potions, item id, mod

Page loaded in: 1.117 seconds