HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Bug with my Dialog

02-09-2004, 04:36 PM#1
starbuk
I have this Dialog that starts at the beginning of the map. The Dialog is working and it looks like this:

(Title)Game Length

(Button 1)10 Minutes -Var=Short
-Action: Set oneshot timer that expires at 10 Minutes
-Action: Create and show timer

(Button 2)20 Minutes -Var=Medium
-Action: Set oneshot timer that expires at 20 Minutes
-Action: Create and show timer

(Button 3)30 Minutes -Var=Long
-Action: Set oneshot timer that expires at 30 Minutes
-Action: Create and show timer

I've set Array Integer Variables for my button and they are named Short, Medium, Long (By the way im not sure what is the difference between array and non-array vars, I've set them to array because I've read it in a tutorial).

My problem is that the timer doesnt start... But at least the dialog is showing up.

Thanks.
02-09-2004, 05:31 PM#2
DoctorDoom
I'll try an analogy. A normal variable is like a box that can hold 1 item in it. The type of variable determines what kind of item can go in it, an interger holds numbers, a unit type saves the unit type. An array variable can hold many items of the same type. The number(default 0) that appears next to an array is like a spot in the box. you can save say a unit type of footman in slot 0, troll in slot 1, peasent in slot 2, etc... Now if you were going to use array variables in this youd only need one. You can set spot 0 to short, spot 1 to med, and spot 2 to long. However I can't help you really with this trigger unless you post your Events, and conditions. Just right click on the trigger in the editor and click copy as text, then paste it here.
02-09-2004, 11:58 PM#3
starbuk
Bah the whole thing was messed up I was doing it totally wrong I think. If you have time can you post how to do it? If you got better to do its ok, I guess ill find out after a few hours of building and messing up triggers. 0_o
02-11-2004, 11:17 AM#4
starbuk
I just need to know how to make a timer start when a button is clicked, depending on wich button the timer will be different. I've explained the structure on the first post, now the only thing I need is someone who can help me by telling me what would be the trigger syntaxe to use...

I've tried IF/THEN/ELSE and it didnt worked pretty well, in fact nothing happened when I clicked a button emote_confused

Help please.
02-11-2004, 11:25 AM#5
johnfn
i think this is what you want.....

events:
dialog - a dialog button is clicked from dialog1 (your dialog)
conditions
clicked dialog button equal to easy (a variable holding one of the buttons)


then make a new variable, call it tmr (or whatever) and make it of type timer.


actions:
start tmr as a one shot timer that will expire in 600 seconds
create timer window for tmr with title time left

p.s. YOu can get the variable for your dialog buttons by doing something like
create button for dialog 1
set easy = (last created dialog button)




hope that helps.
02-11-2004, 12:46 PM#6
starbuk
I did the exact thing and it didnt worked, thats why I came here for help, and cant understand what the problem is. I already had my timer variable, the 3 buttons variable, I used the same syntax and it didnt work at all.

I checked the dialog tutorial and from what I've red I had to make an IF/THEN/ELSE trigger but in the then section there was no timer triggers. So I had to use, like you told me, the condition and action one but didnt worked neither.. Im pretty desperate now heh.

But thanks for confirming that at least I wasnt doing it wrong.. What Ill do is that as soon as I get back home Ill do the whole thing again and if it doesnt work ill post the exact trigger here so maybe someone will be able to spot a mistake I could have made somewhere.

thanks
02-11-2004, 07:54 PM#7
johnfn
alright, i got a new idea. This is something that always, always, always, ALWAYS gets me. try this.


events:
dialog - a dialog button is clicked from dialog1 (your dialog)
Periodic event - every 1 second

instead of

events:
dialog - a dialog button is clicked from dialog1 (your dialog)
02-11-2004, 10:51 PM#8
starbuk
So I would have to put the 2 conditions? What would it change, I mean why making it a periodic event would make the action work?