How do I work out Type Codes?

Post » Tue Feb 08, 2011 4:59 am

Hi there.
Does anyone know the "Type Code" for caravan cards?
Or how I might find it?

I'm working on a script that uses RemoveAllTypedItems to store the player's cards...

Thanks,
Dan
User avatar
Haley Cooper
 
Posts: 3490
Joined: Wed Jun 14, 2006 11:30 am

Post » Tue Feb 08, 2011 10:05 am

A general question is how to find out the hex item code (like 00033bc6) for any item. For items which you see on the screen, you can find out by typing tilde to get the console, then left clicking on the item, then typing tilde again to remove the console.

Does anybody know how to find out the hex item code for items which do not display on the screen, or which do not happen to be onscreen right now?

For writing scripts in geck, you do not use hex item codes. Each item has a normal name. In the geck object window, if you filter for "card", you will find a large number of cards such as CardClubs10B. These must be the caravan cards, since they occur in the lists under Miscellaneous/Caravan Deck. There are a lot of them, so I would think the game would provide a "formlist" to list them all. I can't find one. So there must be some way the game manipulates sets of cards. I looked into scripts and there appears to be a game command AddCardToPlayer, but I can't find any further clues than that.

Although I don't have the complete solution, maybe these bits will help you along the way.
User avatar
Sammie LM
 
Posts: 3424
Joined: Thu Nov 30, 2006 1:59 pm

Post » Tue Feb 08, 2011 8:39 am

I'm sure there was an updated type list in one of the NVSE threads, either way they'd be the people to ask as they've got access to the type lists for use in functions like GetFirstRef.
User avatar
joeK
 
Posts: 3370
Joined: Tue Jul 10, 2007 10:22 am

Post » Tue Feb 08, 2011 4:19 am

Any existing list does not help, for a modder who has added an item. I am sure there must be a simple way to find out what is the item code for an item I added, but I have not figured it out yet.
User avatar
Nuno Castro
 
Posts: 3414
Joined: Sat Oct 13, 2007 1:40 am

Post » Tue Feb 08, 2011 9:03 am

I am sure there must be a simple way to find out what is the item code for an item I added, but I have not figured it out yet.



You mean for an item you've added into your own mod? Like a book or container or armor? You can look it up in NVEdit the same way you'd look up the ID for any item in a mod if you were interested in consoling in the item. Open up NVEdit click none so that mods are deselected and just click on the one mod you are interested in looking in (this saves loading time). Once it's loaded go into the category you are interested in (don't do any filtering or anything) and find the item you are interested in and the Form ID number is what you are looking for.

Or, if you are in the GECK go find your item in it and hover the cursor over it and the item number will appear.

:) llama
User avatar
e.Double
 
Posts: 3318
Joined: Tue Jul 24, 2007 11:17 pm

Post » Tue Feb 08, 2011 9:53 am

A general question is how to find out the hex item code (like 00033bc6) for any item. For items which you see on the screen, you can find out by typing tilde to get the console, then left clicking on the item, then typing tilde again to remove the console.

Does anybody know how to find out the hex item code for items which do not display on the screen, or which do not happen to be onscreen right now?

For writing scripts in geck, you do not use hex item codes. Each item has a normal name. In the geck object window, if you filter for "card", you will find a large number of cards such as CardClubs10B. These must be the caravan cards, since they occur in the lists under Miscellaneous/Caravan Deck. There are a lot of them, so I would think the game would provide a "formlist" to list them all. I can't find one. So there must be some way the game manipulates sets of cards. I looked into scripts and there appears to be a game command AddCardToPlayer, but I can't find any further clues than that.

Although I don't have the complete solution, maybe these bits will help you along the way.


The items FormID (the hex code) is a completely different thing from an item type's type code.
User avatar
Killah Bee
 
Posts: 3484
Joined: Sat Oct 06, 2007 12:23 pm

Post » Tue Feb 08, 2011 2:03 am

You could just call GetType on one and see what it returns.
User avatar
Louise Lowe
 
Posts: 3262
Joined: Fri Jul 28, 2006 9:08 am

Post » Tue Feb 08, 2011 5:56 am

...and that is exactly what I did.

Well done TalkieToaster (and nice Red Dwarf Ref, BTW).

:)

(Although you need the NVSE installed for the GetType command to work)

Caravan Cards Type Code = 115
User avatar
Laura-Jayne Lee
 
Posts: 3474
Joined: Sun Jul 02, 2006 4:35 pm

Post » Tue Feb 08, 2011 4:47 pm

Thanks for the various leads, let me restate my question. (Hopefully not thread hijacking.)

If I am playing, and I have a desperate need for a Fission Battery, I type a console command:

player.additem 00033bc6 1

If I want to do the same thing in a script in geck, I add the line:

player.additem FissionBattery 1

You cannot interchange them for some reason, which I am sure is a complicated programming reason related to storing string data. If I add a new item in geck, say FissionBatteryImproved, it has some formid. But when I type that formid instead of 00033bc6, I get an error about an unrecognized argument. How do I find out the right hex code to type? I mentioned one partial way, if I place an item on the ground in geck, then in game, do ~, left click, it will tell me the code.

But surely there is a place I can find the right hex codes in geck. That would also help giving myself items that don't have convenient geometry, and I wouldn't need to keep the list of all cheat codes for existing items bookmarked either.
User avatar
^_^
 
Posts: 3394
Joined: Thu May 31, 2007 12:01 am

Post » Tue Feb 08, 2011 4:57 am

Editor IDs are basically easily-readable aliases for formID that automatically correct for load order. You can use formIDs in the GECK but it is a bad idea.
To manually correct a formID for load order, replace the first two digits with your mod's load order position in hex, conveniently provided by FOMM/NVMM.
User avatar
stevie critchley
 
Posts: 3404
Joined: Sat Oct 28, 2006 4:36 pm

Post » Tue Feb 08, 2011 3:44 pm

Great, thanks. The bit about replacing the upper two digits with the mod load position is the connection I was missing.
User avatar
Barbequtie
 
Posts: 3410
Joined: Mon Jun 19, 2006 11:34 pm


Return to Fallout: New Vegas