I didn’t know how to call this thread…
I stumbled upon a problem where I want to assign one function to another function which determines what happens next and both functions are triggered always at the same time by multiple triggers.
Here’s a “visual” explanation:
Function(“trigger1”, “setting”)
Function(“trigger2”, “setting”)
Function(“trigger3”, “setting”)
//functions use strings and “triggers” are keyboard buttons
Function Setting()
{
this function sets a variable to appropriate “state”, which is then identified by another function which triggers something. After this point everything is clear to me.
}
User triggers “trigger1” -> “Setting” is triggered -> “Setting” sets a variable to 1 -> Next function does its job
User triggers “trigger2” -> “Setting” is triggered -> “Setting” sets a variable to 69 -> Next function does its job
User triggers “trigger3” -> “Setting” is triggered -> “Setting” sets a variable to “Zantai is a nerd” -> Next function identifies it is not an int -> crash -> Developer of this program is retarded
Basically, I could do it that every trigger uses a different function, which sets the state of the variable, but this is redundant as fuck, would require me to make about 100 new functions (which do the same thing) and I am pretty sure I can do it another way. The “function” function is not my own function, but a built-in one, so I can’t do anything about it. I simply want to trigger one function by every single button I press (and have assigned). I was thinking about making a button identifier for that, but 1. I’d need to make a new big function for that (not a big deal, I guess) and 2. I am afraid that if button A will trigger button B at some point, and both will be assigned, I’ll get an endless loop if B also contains A (otherwise I’ll always get two triggers instead of the one I want).
Is this even doable? I can not think of any reasonable fix for that. The only thing I thought of is using arguments in “Setting” function, but then I can not set anything in there by “Function” function.
I wonder if this thread even makes sense… I need only theory, I didn’t say where I want it nor how because there are people who’d give me ready scripts, and I don’t want that.