Post by anska on Jul 22, 2016 6:42:52 GMT -5
One type of item in my to-do folder is a can, which sims can buy at the retailstore and which will produce 5 tomatos (and an empty can) when opened.
For that purpose I started of with the Interaction Xml of the seedpackets (Gardening_OpenSeedPacket_StarterPacket_Vegetable) because they basically do what I would like my can to do.
However as you can see, the code might do well if you want to create several different types of item but gets incredibly clunky if you want to create several of the same type. Further I would like to have an option to modify the the quality of the tomatos. In both cases (creating a code which creates 5 tomatos instead of 5 times 1 tomato as well as changing the quality), I am at a loss.
The only line that I found in EA's commentary, which somehow seems to be capeable of modifying the items created by create_object is the inital_states tunable list shown below, but I haven't found a way to actually put it to use - probably also because of some syntax error.
<TunableList name="initial_states" class="TunableList" display="Initial States" filter="0" group="General" description="A list of states to apply to the object as soon as it is created.">
<Tunable class="TunableReference" type="object_state" filter="0" group="General" restrict="ObjectStateValue" />
</TunableList>
For that purpose I started of with the Interaction Xml of the seedpackets (Gardening_OpenSeedPacket_StarterPacket_Vegetable) because they basically do what I would like my can to do.
{Code under the Cut}
<V n="outcome" t="single">
<U n="single">
<U n="actions">
<L n="basic_extras">
<V t="destroy_object" />
<V t="create_object">
<U n="create_object">
<V t="definition" n="creation_data">
<U n="definition">
<T n="definition">47457<!--gardenFlowerGENSpinach_01 (Spinach)--></T>
</U>
</V>
<L n="initial_states" />
<V t="inventory" n="location" />
</U>
</V>
<V t="create_object">
<U n="create_object">
<V t="definition" n="creation_data">
<U n="definition">
<T n="definition">45311<!--gardenFruitGENMushroom_01 (Mushroom)--></T>
</U>
</V>
<L n="initial_states" />
<V t="inventory" n="location" />
</U>
</V>
<V t="create_object">
<U n="create_object">
<V t="definition" n="creation_data">
<U n="definition">
<T n="definition">45311<!--gardenFruitGENMushroom_01 (Mushroom)--></T>
</U>
</V>
<L n="initial_states" />
<V t="inventory" n="location" />
<U n="success_chance">
<T n="base_chance">75</T>
</U>
</U>
</V>
<V t="create_object">
<U n="create_object">
<V t="definition" n="creation_data">
<U n="definition">
<T n="definition">47457<!--gardenFlowerGENSpinach_01 (Spinach)--></T>
</U>
</V>
<L n="initial_states" />
<V t="inventory" n="location" />
<U n="success_chance">
<T n="base_chance">75</T>
</U>
</U>
</V>
<V t="create_object">
<U n="create_object">
<V t="definition" n="creation_data">
<U n="definition">
<T n="definition">45299<!--gardenFruitGENCarrot_01 (Carrot)--></T>
</U>
</V>
<L n="initial_states" />
<V t="inventory" n="location" />
<U n="success_chance">
<T n="base_chance">50</T>
</U>
</U>
</V>
<V t="create_object">
<U n="create_object">
<V t="definition" n="creation_data">
<U n="definition">
<T n="definition">47457<!--gardenFlowerGENSpinach_01 (Spinach)--></T>
</U>
</V>
<L n="initial_states" />
<V t="inventory" n="location" />
<U n="success_chance">
<T n="base_chance">25</T>
</U>
</U>
</V>
</L>
</U>
</U>
</V>
However as you can see, the code might do well if you want to create several different types of item but gets incredibly clunky if you want to create several of the same type. Further I would like to have an option to modify the the quality of the tomatos. In both cases (creating a code which creates 5 tomatos instead of 5 times 1 tomato as well as changing the quality), I am at a loss.
The only line that I found in EA's commentary, which somehow seems to be capeable of modifying the items created by create_object is the inital_states tunable list shown below, but I haven't found a way to actually put it to use - probably also because of some syntax error.
<TunableList name="initial_states" class="TunableList" display="Initial States" filter="0" group="General" description="A list of states to apply to the object as soon as it is created.">
<Tunable class="TunableReference" type="object_state" filter="0" group="General" restrict="ObjectStateValue" />
</TunableList>