Resource Container Object

From SWGANH Wiki
Revision as of 19:58, 16 January 2007 by Schmunzel (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Resources in the inventory are created through sending a set of Packets that is very similiar to those which are send for creating other items in the Inventory. The main difference is that resources are not created through CREO Packets but that for Resource Creation ONCR Packets are used.

The creation process begins with an Object Init Packet and an Object Link packet, the main data is send through an ONCR 3 and an ONCR 6 packet and the creation process is ended through an ONCR8, ONCR9, an object finish and an Posture update Packet.

there are still some parts of the ONCR 3 and 6 Packets which are not figured out yet, though as far as I can see they are hopefully not that important.

Please note that -like with everything- these packets can be send standalone in an 00 09 or in the pack as an 00 19. to make this a bit clearer I seperate them as single packets. I did not include the headers though (00 09 wx yz and crc at the end) because thats getting redundant.

The object init Packet contains the ID of the newly created -(resource) Item, the crc of the item to be displayed and its location and orientation in the world should it not happen to be in the inventory / backpack.

Packet: SceneCreateObjectByCrc Server --> Client


05 00                             operand count
ea dd 89 fe                       Opcode SceneCreateObjectByCrc
ea b7 e9 33 18 00 00 00           This is the ID of the newly created 
                                  Item / resource

00 00 00 00                       This is probably the orientation the item 
00 00 00 00                       is displayed in when in the world
00 00 00 00 

00 00 80 3f                       this is some unknown float value (1.0 in this case)

91 e2 c7 45                       Position X                  They probably dont have to be send
17 33 3a 43                       Position Z (Y)              When the resource is created in the 
d9 54 8e c5                       Position Y (Z)              Inventory or backpack

6d 5e ce 88                       CRC resource container 

00                                one single 00

The SMSG_OBJ_LINK packet links the item to the container where its to be created in. This is either a backpack, an inventory, and probably a hopper or house, too.

Packet: UpdateContainmentMessage Server --> Client
04 00 

9e de cb 56                       UpdateContainmentMessage

ea b7 e9 33 18 00 00 00           ID of the created Item / resource

96 5c 2b 03 18 00 00 00           ID of the players Inventory / or the backpack, or the hopper.......

ff ff ff ff                       ???? in the creos the value is 4 in the NGE Logs Ive seen ff ff ff ff .....

This is the ONCR 3 Packet. here we give the client the info about how many resources we have, and what to display as resource name

Packet: SMSG_OBJ_UPDATE - ONCR 3 Server --> Client

[UINT16] 05 00                   operand 

[UINT32] OPCODE                  SMSG_OBJ_UPDATE

[UINT64] ID                      ITEM / resource ID

[UINT32] ONCR                    ONCR 3 Packet
[UINT8]  3

[UINT32] PACKETLENGTH             the length of the Packet following this dword

[UINT16] Operand d                perhaps the number of object operands???? highly doubt that

[UINT32] evtl float?????
00 00 80 3f                       //dunno same as the above value is also found in 
                                  //the nge creo packets I have

[UINT16] length String            length string and string - This string contains the directoryname  
[String]                          where the stringtable is found in which the name of the resource type 
                                  is stored that will be displayed. WITHOUT @!!!!!!
                                  I found this for our Pub 13 client to be : "kb/kb_resources_n"

[UINT32] 00 00 00 00                       

[UINT16]length String             length string and string - this is the selector for the resourcetype name
[String]                          eg "fungi" look it up in the patch12-TRE  for further info


[UINT32] 00 00 00 00                       
[UINT32] 01 00 00 00 

[UINT32] 00 00 00 00 
[UINT32] 00 00 00 00      
[UINT32] 00 00 00 00 

[UINT32] 00 00 00 00 
[UINT32] 00 00 00 00 

[UINT16] 00 00 

[UINT32] 64 00 00 00 

[UINT8]  01 

[UINT32] AMOUNT                     this is the amount of the resource 

[UINT64] TEMPLATE-ID                this is the ID of the resource template the resource is based upon
Packet: BaselinesMessage - ONCR 6 Server --> Client

[UINT16] 05 00 

[UINT32] 0c 5f a7 68 			BaselinesMessage

[UINT64]                 					object ID

[UINT32] 4f 4e 43 52 						ONCR 6

[UINT8]  6

[UINT32] size							size of the remaining packet

[UINT16] 6 							item operand count ???? doubt that.....

[UINT32] 5e 00 00 00						(!!??!!) different values in the NGE
                                                                depending on resource

CAVECAVECAVECAVECAVE!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!111oneelevenCAVECAVECAVECAVE
have to be an empty string and zero string length in our pub13 client!!!!!!

[UINT16] length                                                 length of string
[STRING]                                         	        string "resource_container_d" cave zero length 
                                                                and empty string for pub 13 client
							 
[UINT32] 00 00 00 00 

CAVECAVECAVECAVECAVE!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!111oneelevenCAVECAVECAVECAVE
have to be an empty string and zero string length in our pub13 client!!!!!!

[UINT16] length                                                 length of string
[STRING]                                         	        string "anorganic_minerals_small" cave zero length 
                                                                and empty string for pub 13 client


[UINT32] a0 86 01 00                                             dezimal 100.000 its the max stack size but 
                                                                has somehow no effect.....??????

[UINT16] length                                                 length string
[STRING]                                                        "armophous_rudic"
                                    				
[UINT32] length                                                  UNICODE string
[STRING]                                                        [Resource Name]

[UINT32] 00 00 00 00        
[UINT32] 00 00 00 00

Packet: BaselinesMessage - ONCR 8 Server --> Client


[UINT16] 05 00                                                  operand count

[UINT32] 0c 5f a7 68                   BaselinesMessage

[UINT64]                                                        Obj ID

[UINT32] 4f 4e 43 52 08                                         ONCR 8

[UINT8]  8

[UINT16] 02 00 

[UINT32] 00 00 00 00 
Packet: BaselinesMessage - ONCR 9 Server --> Client

[UINT16] 05 00 

[UINT32] 0c 5f a7 68                  BaselinesMessage

[UINT64]                                                        OBJ ID

[UINT32] 4f 4e 43 52                                            ONCR 9

[UINT8]  9

[UINT16] 02 00 

[UINT32] 00 00 00 00 
Packet: SceneEndBaselines - ONCR 6 Server --> Client

[UINT16] 02 00 

[UINT32] 37 60 43 2c                  SceneEndBaselines

[UINT64]                                                        OBJ ID