The menus only allow you to do this by adding a Function Definition.
By adding a function definition it will allow you to use it in an IF ELSE statement or just set a variable equal to function.
Technically they are all functions. So if you use custom script you should be able to use the same concept of calling the function from setting a variable or through a IF ELSE statement.
Example:
Function "BuildUnit" returns boolean "True"
1. Set a variable:
Local Boolean Variable "ReturnResult"
Set ReturnResult = BuildUnit(Parameters)
2. Through a If Else statement:
If (BuildUnit(Parameters) == True) Then
Xav makes this point... If a function has a return value, it means you can replace the whole function with that data type in another function (you just have to konw the conditions of it's return values). This is more of a programming concept and can be difficult to understand without specific examples...
Rollback Post to RevisionRollBack
To post a comment, please login or register a new account.
There is an option where you can choose what you want to return in action definition, but I have no idea how to use it.
There is also Return function in action menu, but even if you add something to it, it doesnt return it anywhere....
So pls help me and give me good example how to do this. I really need this....
you have to make a function not a trigger!
The menus only allow you to do this by adding a Function Definition.
By adding a function definition it will allow you to use it in an IF ELSE statement or just set a variable equal to function.
Technically they are all functions. So if you use custom script you should be able to use the same concept of calling the function from setting a variable or through a IF ELSE statement.
Example: Function "BuildUnit" returns boolean "True"
1. Set a variable: Local Boolean Variable "ReturnResult" Set ReturnResult = BuildUnit(Parameters)
2. Through a If Else statement: If (BuildUnit(Parameters) == True) Then
Ok thx guys...too bad I cant do it the way I want, but gotta do it another way then :)
Xav makes this point... If a function has a return value, it means you can replace the whole function with that data type in another function (you just have to konw the conditions of it's return values). This is more of a programming concept and can be difficult to understand without specific examples...