but what I dont understand is WHY is it better to use those thingies, and I really have no clue which of those things I wanna use for making my dialog. atm Ive been messing around abit and Ive got an action definition with X and Y parameters to be used as dimensions for my dialog, but when I put this thing in my trigger it just asks me what the value of X and Y is, so why would I not just make a <Create dialog with width X and height Y> with X and Y as variables then, instead of as parameters? sounds alot less complicated to me...
anyway the basic question is: whats the point? :P
thanks for answering and sorry for my noobness but I couldnt really find any posts about this and the tutorial is kinda outdated so I dont know if anyone is still replying there.
You dont need to set parameters for that. Parameters are normaly just to make it easier to players that dint created that action/event or function definition.
Parameters are used in Functions ... When you create a Parameter, you should out of habit create a variable with the same name that is set to the parameter.
For instance;
x (parameter)
x (variable) = x (parameter)
actions ...
blah blah.
Parameters are basically information you "feed" into a function to tell it what to do, here is a very simple function I wrote especially for use in dialogs ...
NameOfPlayerinColourOptions:FunctionReturnType:TextParametersplayer=0<Integer>GrammarText:NameOfPlayerinColour(player)HintText:(None)CustomScriptCodeLocalVariablesplayer=player<Integer>text=NoText<Text>ActionsVariable-Settext=(Combine("<c val="", (Text((Convert color (Color((Current player player color))) to string))), "">",(Nameofplayerplayer),"</c>"))General-Returntext
What you use it for is you can do Set Dialog Text = Name Of Player In Colour(x), and it will set the dialog text to the player's name in the player's colour. Try to recreate the above and you should have a understanding of functions and parameters.
EDIT >>
To clarify, you should never ever use parameters inside your code, always use variables that are set to the parameters. If you dont need parameters, just use variables.
Also, use Records, don't create 800 global variables.
Im trying to create my own fully customised dialog, and I believe that for some reason its better to use a function or event definition or action definition and I dont know what else, now I found a good guide about this for anyone interrested: http://forums.sc2mapster.com/resources/tutorials/2051-beginners-guide-to-triggers-variables-arrays-constants/#p16.
but what I dont understand is WHY is it better to use those thingies, and I really have no clue which of those things I wanna use for making my dialog. atm Ive been messing around abit and Ive got an action definition with X and Y parameters to be used as dimensions for my dialog, but when I put this thing in my trigger it just asks me what the value of X and Y is, so why would I not just make a <Create dialog with width X and height Y> with X and Y as variables then, instead of as parameters? sounds alot less complicated to me...
anyway the basic question is: whats the point? :P
thanks for answering and sorry for my noobness but I couldnt really find any posts about this and the tutorial is kinda outdated so I dont know if anyone is still replying there.
You dont need to set parameters for that. Parameters are normaly just to make it easier to players that dint created that action/event or function definition.
does it cost less memory than a loop or something?
Parameters are used in Functions ... When you create a Parameter, you should out of habit create a variable with the same name that is set to the parameter.
For instance;
x (parameter)
x (variable) = x (parameter)
actions ...
blah blah.
Parameters are basically information you "feed" into a function to tell it what to do, here is a very simple function I wrote especially for use in dialogs ...
What you use it for is you can do Set Dialog Text = Name Of Player In Colour(x), and it will set the dialog text to the player's name in the player's colour. Try to recreate the above and you should have a understanding of functions and parameters.
EDIT >>
To clarify, you should never ever use parameters inside your code, always use variables that are set to the parameters. If you dont need parameters, just use variables.
Also, use Records, don't create 800 global variables.