I want to creat a very simple map. There is only one Marine in a map 32x32. This Marine will be modified with Triggers. The triggers will occure when pressing buttons in dialogs. Actually, I want to make as many as possible buttons that will affect the Scale, the Color, the Lightning, the rotation, the height, whatever is possible. I have at the moment, my Marine and 1 Dialog with 2 buttons. One is named Bigger, one is named Smaller. So, one will change his scale % positivly and the other one negativly.
I have a problem, even if my triggers are seperate and the buttons stored in the Data table, when I try to make a trigger be specific to a button, like Bigger, it makes the two buttons activate. Meaning, the Scale is bigger and smaller at the same time, so, the Marine is just not changing. I've notice this when I added a trigger that send a text message every times I press the buttons, the text message show the value of my variable that represent the Scale of the marine.
So, why are my two buttons activated at the same time whatever witch one is pressed?
There is a way to detect which dialog button is pressed, I have yet to touch dialog buttons though. (A few quick Google searches should answer it if you're determined, I remember reading it, I just don't remember it off the top of my head. Though I'm sure someone else will answer it soon.)
But for prototyping (which it seems is what you're doing) I would use Screen Buttons instead, you should be able to find them under triggers. They're much more straightforward to set up, and they are assigned a trigger to call when pressed. They're simple, but for prototyping, it's all you really need, and I'd suggest using them over dialog buttons if you're not trying to make a fancy UI for an end user.
The way I've always done it is basically the same as you're doing, except using global variables instead of a Data Table:
You need to create one Dialog Item variable per button, assigned during dialog creation using "Variable - Set MyButtonVariable = Last Created Dialog Item" where you currently have your Data Table save actions. (In this example I'm calling my button var "ButtonBigger"
Then, your triggers need to look something like this:
A great thanks. I've made some more buttons and played around with the Dialogs possibilities.
Look at my map :P I'll try to continute it. It is just for praticing and better understanding of the dialogs and triggers in general. For example, when we meet a bug, why isn't this working... then you try and try...
As a first debug I use just a trigger to show the value of the actual Button modified. So I know if the trigger works (if it show a number) and if its doing like two numbers at once when it is not supposed. Meaning, two triggers is activated at the same time. I worked hard for the last button that change a marine into a tank and vice versa. The trigger was always saying that it changed into the tank and exacly at the same time changed back into the marine... So after a moment I had the idea to add a wait and see what happend. It was working. So I changed the wait to 0.05sec and there you go. When I was pressing the button, the triggers were too fast and activated at the same time. (We are no more in Starcraft 1 with slow triggers even with HyperTrigger xD)
So, after all this, I'm little bit more able to do something with dialogs! XD I still want to know more from them.
I also noticed 2 bugs, one that stuck the default animations when playing with the animation and the changing aspect. The other that is when you make your unit be super big. The trigger execute a x2 everytimes you click. So, it's not long before the 100% become something like 35000%... but after a moment, the number become negative. So big that it is something like -94723, then, if you keep this number negative and you make him be smaller, divided by 2, it keeps the negative and the Dialog start flashing strangely. It likes if the model became in the negative and makes some bugs. And if you just keep making him bigger you get the number 0 and you can't make him reappear except by using the Reset button.
If it happends to you and you are not able to make him come back, don't panic, there is reset button in the bottom right corner =)
Your problem is that you need to specify condition "used dialog item == "Petit" from Global Data Table". The "dialog item used" event fires when ANY button is pressed. See here:
Thanks but I've made a better version :D Just up of your post.
By now I know that I need that condition. But, what is the difference between using Data Table and variables? Except the way we name the things and the way we call them back (even if it is pretty similar) Is one better to use, more simple, less buggy, idk... ?
You pretty much can't go wrong using just variables. Global data tables are more powerful, similar to using variable arrays.
Global data table
pros: unlimited length, can recall values based on strings, strings could be made in-game, destroyable
cons: only one data table available for any given variable type
Variable array
pros: extremely versatile, can recall values based on integers, integers could be variables themselves
cons: must define its size beforehand
But what ever you use, you can make variable while global data table is used, and while using global data table you can use variables through it. With the conversion things and everything xD We can use almost everything to creat everything >.<
"Only one data table available for any given variable type" This mean, only 1 integer, 1 Dialogs item, 1... etc?
I want to creat a very simple map. There is only one Marine in a map 32x32. This Marine will be modified with Triggers. The triggers will occure when pressing buttons in dialogs. Actually, I want to make as many as possible buttons that will affect the Scale, the Color, the Lightning, the rotation, the height, whatever is possible. I have at the moment, my Marine and 1 Dialog with 2 buttons. One is named Bigger, one is named Smaller. So, one will change his scale % positivly and the other one negativly.
I have a problem, even if my triggers are seperate and the buttons stored in the Data table, when I try to make a trigger be specific to a button, like Bigger, it makes the two buttons activate. Meaning, the Scale is bigger and smaller at the same time, so, the Marine is just not changing. I've notice this when I added a trigger that send a text message every times I press the buttons, the text message show the value of my variable that represent the Scale of the marine.
So, why are my two buttons activated at the same time whatever witch one is pressed?
Working on projects:
@Scbroodsc2: Go
There is a way to detect which dialog button is pressed, I have yet to touch dialog buttons though. (A few quick Google searches should answer it if you're determined, I remember reading it, I just don't remember it off the top of my head. Though I'm sure someone else will answer it soon.)
But for prototyping (which it seems is what you're doing) I would use Screen Buttons instead, you should be able to find them under triggers. They're much more straightforward to set up, and they are assigned a trigger to call when pressed. They're simple, but for prototyping, it's all you really need, and I'd suggest using them over dialog buttons if you're not trying to make a fancy UI for an end user.
Screen button works perfectly. But, how if I wanted to make them with the Dialog button?
Working on projects:
@Scbroodsc2: Go
The way I've always done it is basically the same as you're doing, except using global variables instead of a Data Table:
You need to create one Dialog Item variable per button, assigned during dialog creation using "Variable - Set MyButtonVariable = Last Created Dialog Item" where you currently have your Data Table save actions. (In this example I'm calling my button var "ButtonBigger"
Then, your triggers need to look something like this:
I've never had problems with this method.
@Telthalion: Go
A great thanks. I've made some more buttons and played around with the Dialogs possibilities.
Look at my map :P I'll try to continute it. It is just for praticing and better understanding of the dialogs and triggers in general. For example, when we meet a bug, why isn't this working... then you try and try...
As a first debug I use just a trigger to show the value of the actual Button modified. So I know if the trigger works (if it show a number) and if its doing like two numbers at once when it is not supposed. Meaning, two triggers is activated at the same time. I worked hard for the last button that change a marine into a tank and vice versa. The trigger was always saying that it changed into the tank and exacly at the same time changed back into the marine... So after a moment I had the idea to add a wait and see what happend. It was working. So I changed the wait to 0.05sec and there you go. When I was pressing the button, the triggers were too fast and activated at the same time. (We are no more in Starcraft 1 with slow triggers even with HyperTrigger xD)
So, after all this, I'm little bit more able to do something with dialogs! XD I still want to know more from them.
I also noticed 2 bugs, one that stuck the default animations when playing with the animation and the changing aspect. The other that is when you make your unit be super big. The trigger execute a x2 everytimes you click. So, it's not long before the 100% become something like 35000%... but after a moment, the number become negative. So big that it is something like -94723, then, if you keep this number negative and you make him be smaller, divided by 2, it keeps the negative and the Dialog start flashing strangely. It likes if the model became in the negative and makes some bugs. And if you just keep making him bigger you get the number 0 and you can't make him reappear except by using the Reset button.
If it happends to you and you are not able to make him come back, don't panic, there is reset button in the bottom right corner =)
Working on projects:
@Telthalion: Go
Your problem is that you need to specify condition "used dialog item == "Petit" from Global Data Table". The "dialog item used" event fires when ANY button is pressed. See here:
@hunterx3: Go
Thanks but I've made a better version :D Just up of your post. By now I know that I need that condition. But, what is the difference between using Data Table and variables? Except the way we name the things and the way we call them back (even if it is pretty similar) Is one better to use, more simple, less buggy, idk... ?
Working on projects:
@Scbroodsc2: Go
You pretty much can't go wrong using just variables. Global data tables are more powerful, similar to using variable arrays.
Global data table
pros: unlimited length, can recall values based on strings, strings could be made in-game, destroyable
cons: only one data table available for any given variable type
Variable array
pros: extremely versatile, can recall values based on integers, integers could be variables themselves
cons: must define its size beforehand
@hunterx3: Go
But what ever you use, you can make variable while global data table is used, and while using global data table you can use variables through it. With the conversion things and everything xD We can use almost everything to creat everything >.<
"Only one data table available for any given variable type" This mean, only 1 integer, 1 Dialogs item, 1... etc?
Working on projects: