Let me preface this by saying that I am aware that the way I use Fungus is not quite an intend way of using it. I am using an external database (Databox) to store variables instead of using Fungus variables. It's easier to query them by my other systems and I'd like to avoid using PlayerPrefs altogether.
Because my variables are stored elsewhere, I cant just get the IF/ELSEIF commands to fetch them like you would with normal Fungus variables - instead I have to use Invoke Method first, then save the return value to a variable, and then query those without saving them. This is a bit of a workaround that I'm hoping to bridge by creating a custom IF/ELSEIF command that basically have a functionality similar to that of InvokeMethod built in and directly work with the return values of the function that query these values from a database.
I've already managed to create a new IF_2 command that takes a list of strings (statConditions) that get sent to another script, which then returns a bool. The operation is called "IsStatGreaterOrEqual".
The scripts communicate, and there is a return value triggered, but the IF_2 command never gets it back:
Intended Behaviour
The return values from the Dbox_ChapterStats' IsStatGreaterOrEqual methods to be "given back" to the If_2 so that it may perform actions with it. It should essentially work like a simple bool operation, but instead of taking the bool from a fungus variable, it takes it from the return value.
Let me preface this by saying that I am aware that the way I use Fungus is not quite an intend way of using it. I am using an external database (Databox) to store variables instead of using Fungus variables. It's easier to query them by my other systems and I'd like to avoid using PlayerPrefs altogether.
Because my variables are stored elsewhere, I cant just get the IF/ELSEIF commands to fetch them like you would with normal Fungus variables - instead I have to use Invoke Method first, then save the return value to a variable, and then query those without saving them. This is a bit of a workaround that I'm hoping to bridge by creating a custom IF/ELSEIF command that basically have a functionality similar to that of InvokeMethod built in and directly work with the return values of the function that query these values from a database.
I've already managed to create a new IF_2 command that takes a list of strings (statConditions) that get sent to another script, which then returns a bool. The operation is called "IsStatGreaterOrEqual".
I made the following modifications:
Current Behaviour
The scripts communicate, and there is a return value triggered, but the IF_2 command never gets it back:
Intended Behaviour
The return values from the Dbox_ChapterStats' IsStatGreaterOrEqual methods to be "given back" to the If_2 so that it may perform actions with it. It should essentially work like a simple bool operation, but instead of taking the bool from a fungus variable, it takes it from the return value.
Any advice would be appreciated. Thank you