Page 1 of 1

Struct element clarification

Posted: Tue Jul 21, 2009 6:00 pm
by Zcoretri
LE, what do those elements in red mean, what happens to the value?

<Data ElementName="offers_quest" Type="EQ2_8Bit_String" Size="1" IfVariableNotSet="footer_set_name_0" />
<Data ElementName="part_of_quest" Type="EQ2_8Bit_String" Size="1" IfVariableNotSet="footer_set_name_0" />
<Data ElementName="offers_quest_color" Type="int8" IfVariableSet="footer_offers_quest_0" />
<Data ElementName="part_of_quest_color" Type="int8" IfVariableSet="footer_part_of_quest_0" />
<Data ElementName="unknown_set_data1" Type="int8" Size="1" IfVariableSet="footer_set_name_0" />
<Data ElementName="charges" Type="int8" IfVariableNotSet="footer_set_name_0" />
<Data ElementName="total_charges" Type="int16" IfVariableSet="footer_charges_0" />
<Data ElementName="charges_left" Type="int16" IfVariableSet="footer_charges_0" />
<Data ElementName="unknown_set_info" Type="int32" Size="1" IfVariableSet="footer_set_name_0" />
<Data ElementName="unknown_set_info2" Type="int8" Size="1" IfVariableSet="footer_set_name_0" />
<Data ElementName="unknown_set_info3" Type="int32" Size="1" IfVariableSet="footer_unknown_set_info2_0" />

Re: Struct element clarification

Posted: Tue Jul 21, 2009 6:11 pm
by LethalEncounter
IfVariableNotSet="FIELD" means that if the FIELD is a 0, then this data element is used, otherwise it is skipped.

IfVariableSet="FIELD" means that if the FIELD is NOT 0, then this data element is used, otherwise it is skipped.

In your example if the footer_set_name_0 field for the packet is 0 then the offers_quest field is used, otherwise it is skipped.
Likewise, unknown_set_data1 is only used if footer_set_name_0 is set. Its just my way of trying to handle all the crazy curveballs that SOE throws into their data.

Re: Struct element clarification

Posted: Tue Jul 21, 2009 6:40 pm
by Zcoretri
OK, just trying to wrap my brain around this stuff, lol....

So, if there is there is no value for set_name (meaning its = 00), then...
<Data ElementName="unknown_set_data1" Type="int8" Size="1" IfVariableSet="footer_set_name_0" /> is skipped and
<Data ElementName="offers_quest" Type="EQ2_8Bit_String" Size="1" IfVariableNotSet="footer_set_name_0" /> is used.

So being skipped I assume that there is no value there at all? (i.e. not a 00)

Re: Struct element clarification

Posted: Wed Jul 22, 2009 2:43 pm
by LethalEncounter
That is correct. Being skipped means that it will not be used when loading a data packet or creating a new data packet. To the client, that field never existed.