Hopefully someone can help me here. I want to write a new class that has some tunable settings. As soon as these are loaded, I then want to use the values to do something else. However, I have been unable to get the game to read my tuning.
For instance, in the code below ("my_tuning.py") I have a custom class with two tunables: A_NUMBER and A_TRAIT. I set up a command to print the value of MyTuning.A_NUMBER and it's always 0.1 (the value of A_TRAIT is None because I didn't set a default), regardless of the value I specify in the corresponding XML.
from sims4.commands import Command, CheatOutput, CommandType
from sims4.tuning.tunable import Tunable
from traits.traits import Trait
A_NUMBER = Tunable(
tunable_type = float,
default = 0.1)
A_TRAIT = Trait.TunableReference()
# do stuff with cls.A_NUMBER and cls.A_TRAIT
output = CheatOutput(_connection)
This is the XML I'm trying to load (03B33DDF!00000000!F9C4C5D3009CC2E9.my_tuning.Tuning.xml). The guid (17997727520918389481) is the FNV64 of the Python's module name: "my_tuning."
<?xml version="1.0" encoding="utf-8"?>
<M n="my_tuning" s="17997727520918389481">
Is there something I'm missing? Or is loading tuning for modules/classes something that only works for EA classes?
If anyone can help or shed a light in the right direction, it would be greatly appreciated!