Can I make a Function that will calculate all that I need it to, then as a side process, output the information to another Function to do additional actions? The reason is I need to have 2 different kinds of outputs, one being Integers and the other being Reals and the second function is completely dependent upon the output of the first function.
So what I'm trying to accomplish is 1) dynamically entering information into an array for a new unit that meets proper conditions and 2) taking the integers that go into the array and making a unique identifying ID which then is set to a triggering unit's Custom Value (because I'm trying to track properties of that unit).
Here is a quick diagram I drew up to try and demonstrate what I'm trying to accomplish.
I haven't made a map or mod before, so I'm still trying to learn as I go... but is this even possible? Or is there a better way of handling this?
I like the idea on the global variables, that's good. I could then make a trigger with no events that writes those variables into the array, but is manually ran at the end of the function's actions, yeah?
Alternatively, you could try storing your information in data tables or encode it in a string that you can decode later. But those methods are a little more complicated.
Honestly I don't even know what a data table is, aside from one exists, you can't make more and you just put information there.
It never really sprung out at me as a solution to investigate because the properties of the units I'm going to be tracking are going to be queried and calculations done on those queries about once a second and the information needs to be created and erased as units are born and die.
Would a data table be an ideal solution for something like that, complications be damned?
Rollback Post to RevisionRollBack
To post a comment, please login or register a new account.
Can I make a Function that will calculate all that I need it to, then as a side process, output the information to another Function to do additional actions? The reason is I need to have 2 different kinds of outputs, one being Integers and the other being Reals and the second function is completely dependent upon the output of the first function.
So what I'm trying to accomplish is 1) dynamically entering information into an array for a new unit that meets proper conditions and 2) taking the integers that go into the array and making a unique identifying ID which then is set to a triggering unit's Custom Value (because I'm trying to track properties of that unit).
Here is a quick diagram I drew up to try and demonstrate what I'm trying to accomplish.
I haven't made a map or mod before, so I'm still trying to learn as I go... but is this even possible? Or is there a better way of handling this?
You can not return or pass over arrays. Nevertheless nothing prevents you from calling another function within your Integer master Function.
You will then have to save the function results in a different way, for example a global variable.
Edit: The best approach seems to make your Integer Master Function an action definition which calls the three seperate subfunctions.
I like the idea on the global variables, that's good. I could then make a trigger with no events that writes those variables into the array, but is manually ran at the end of the function's actions, yeah?
@Darkenesis: Go
Alternatively, you could try storing your information in data tables or encode it in a string that you can decode later. But those methods are a little more complicated.
@FuzzYD: Go
Honestly I don't even know what a data table is, aside from one exists, you can't make more and you just put information there.
It never really sprung out at me as a solution to investigate because the properties of the units I'm going to be tracking are going to be queried and calculations done on those queries about once a second and the information needs to be created and erased as units are born and die.
Would a data table be an ideal solution for something like that, complications be damned?