Post by halfwolf102 on Apr 16, 2023 11:33:24 GMT -5
Hello! I am trying to make a mod that makes thermostats upgradable to be automatic. I'm trying to get the base behavior as I want it before I make it upgradable but I've ran into an issue. While I was able to figure out the automated portion thanks to another mod, It locks interaction for the default options (Off, Warmer, Cooler) while the respective option is active but I want them to be unlocked while the automatic option is on. So I'm trying to change the default interaction tuning for these options to make it work this way.
This is the code that I have (this is specifically for the cooling option):
<L n="test_globals">
<V t="sim_info">
<U n="sim_info">
<V n="ages" t="specified" />
<V n="species" t="specified">
<U n="specified">
<L n="species">
<E />
</L>
</U>
</V>
<E n="who">Actor</E>
</U>
</V>
<V t="state">
<U n="state">
<E n="operator">NOTEQUAL</E>
<V n="tooltip" t="enabled">
<T n="enabled">0x544AE835<!--Thermostat already set to Cooler--></T>
</V>
<T n="value">187698<!--Thermostat_LotStat_Setting_Low--></T>
<T n="value">3154629786164256605<!--Halfwolf102:thermostat_AutoState_Off--></T>
</U>
</V>
</L>
It kind of works how I want it to, but not entirely. While it unlocks the cooling option while automatic operation is on, It also locks interaction when either cooling is on or when automatic operation is off. I only want it locked when both cooling is on and automatic operation is off. How do I get it to work like this?
EDIT:
I solved my own issue! I think what I was originally trying to to isn't possible, so I found a workaround (or correct solution is it is impossible). I replaced the single interaction to set the temperature with two different interactions, one for when automatic mode is on and a different one for when automatic mode is off, and the interaction is hidden when it's not needed. In case anyone else has a problem similar to this, here is the revised code.
Cooling interaction when automatic mode is on:
Cooling interaction when automatic mode is off:
<L n="test_globals">
<V t="sim_info">
<U n="sim_info">
<V n="ages" t="specified" />
<V n="species" t="specified">
<U n="specified">
<L n="species">
<E />
</L>
</U>
</V>
<E n="who">Actor</E>
</U>
</V>
<V t="state">
<U n="state">
<E n="operator">EQUAL</E>
<T n="value">5451228909861312593<!--Halfwolf102:thermostat_AutoState_On--></T>
</U>
</V>
</L>
Cooling interaction when automatic mode is off:
<L n="test_globals">
<V t="sim_info">
<U n="sim_info">
<V n="ages" t="specified" />
<V n="species" t="specified">
<U n="specified">
<L n="species">
<E />
</L>
</U>
</V>
<E n="who">Actor</E>
</U>
</V>
<V t="state">
<U n="state">
<E n="operator">EQUAL</E>
<T n="value">3154629786164256605<!--Halfwolf102:thermostat_AutoState_Off--></T>
</U>
</V>
<V t="state">
<U n="state">
<E n="operator">NOTEQUAL</E>
<V n="tooltip" t="enabled">
<T n="enabled">0x544AE835<!--Thermostat already set to Cooler--></T>
</V>
<T n="value">187698<!--Thermostat_LotStat_Setting_Low--></T>
</U>
</V>
</L>