Forum Announcement, Click Here to Read More From EA_Cade.

Using return value of python method as interaction test?

IngeJonesIngeJones Posts: 3,247 Member
edited March 5 in Nominated Threads
@SimGuruModSquad or @SimGuruEugi what is the way to use the boolean return value of a custom python function as a test for interaction validity?
Post edited by EA_Cade on

Comments

  • SimGuruEugiSimGuruEugi Posts: 503 SimGuru
    edited February 2016
    You would have to define your own interaction class, and have your tuning point to it.
    Alternatively, you could add a new type of test and also link it via the tuning.
    Post edited by SimGuruEugi on
  • IngeJonesIngeJones Posts: 3,247 Member
    Ok, so no current ready "hook" for that?
  • SimGuruEugiSimGuruEugi Posts: 503 SimGuru
    Correct. There is no way to associate arbitrary Python code to a tunable test.
  • DragonSireDragonSire Posts: 12 New Member
    > @SimGuruEugi said:
    > You would have to define your own interaction class, and have your tuning point to it.
    > Alternatively, you could add a new type of test and also link it via the tuning.

    My understanding is all tests available in tunable interactions are contained within TunableTestVariant. I am not seeing an obvious way to allow a custom test to be added, recognized and work. Could you provide an example, or link to one?

    As an example I was looking to see if any of the tests would simply return the true/false state of a global variable, contained within a module.
  • SimGuruEugiSimGuruEugi Posts: 503 SimGuru
    It would not be a test in TunableTestVariant. You would need a script mod with a new Interaction class that implements its own version of the test() method.
  • DragonSireDragonSire Posts: 12 New Member
    > @SimGuruEugi said:
    > It would not be a test in TunableTestVariant. You would need a script mod with a new Interaction class that implements its own version of the test() method.

    So you would have to inherit an instance class, to implement a custom test()? Would have thought there would be an option to simply call a static function by name, and return true/false. At least I know where I need to look, thanks.

Leave a Comment

BoldItalicStrikethroughOrdered listUnordered list
Emoji
Image
Align leftAlign centerAlign rightToggle HTML viewToggle full pageToggle lights
Drop image/file
Return to top