|
|
EDIT Question about light
#203485
04/22/08 12:55
04/22/08 12:55
|
Joined: Feb 2007
Posts: 53
n00bie
OP
Junior Member
|
OP
Junior Member
Joined: Feb 2007
Posts: 53
|
Hi, With the Lite-c tutorial (who is very usefull) I've created my own menu. Except one thing: the user must open the menu anytime with the escape key. This won't work. The script: What's wrong?
Last edited by n00bie; 04/24/08 13:24.
|
|
|
Re: Problem with panels...
[Re: PadMalcom]
#203500
04/22/08 14:24
04/22/08 14:24
|
Joined: Jan 2002
Posts: 4,225 Germany / Essen
Uhrwerk
Expert
|
Expert
Joined: Jan 2002
Posts: 4,225
Germany / Essen
|
Your flag definition is alright. But you have to place "on_esc = open_menu; " inside a function, e.g. the main function or start_simulate. Event definitions are not allowed outside functions in Lite-C.
Always learn from history, to be sure you make the same mistakes again...
|
|
|
Re: Problem with panels...
[Re: n00bie]
#203833
04/24/08 13:23
04/24/08 13:23
|
Joined: Feb 2007
Posts: 53
n00bie
OP
Junior Member
|
OP
Junior Member
Joined: Feb 2007
Posts: 53
|
A new question in this topic: What's wrong with this while I convert it from C-script to Lite-C?
action stroboscoop ()
{
my.lightrange = 600;
set(my,LIGHT);
while (1)
{
if(key_space == 0)
{
my.red = 0;
my.blue = 0;
my.green = 0;
}
if(key_space == 1)
{
my.red = 255;
my.blue = 255;
my.green = 255;
wait(-0.075)
my.red = 0;
my.blue = 0;
my.green = 0;
wait(-0.075)
}
}
wait(1);
}
|
|
|
Re: Problem with panels...
[Re: n00bie]
#203858
04/24/08 16:13
04/24/08 16:13
|
Joined: Apr 2007
Posts: 582 Germany
Poison
User
|
User
Joined: Apr 2007
Posts: 582
Germany
|
action stroboscoop ()
{
my.lightrange = 600;
set(my,LIGHT);
while (1)
{
if(key_space == 0)
{
my.red = 0;
my.blue = 0;
my.green = 0;
}
if(key_space == 1)
{
my.red = 255;
my.blue = 255;
my.green = 255;
wait(-0.075)
my.red = 0;
my.blue = 0;
my.green = 0;
wait(-0.075)
}
wait(1); //<------------ That was your failure
}
}
You forgot to set wait(1) into the while loop.
Everything is possible, just Do it!
|
|
|
Re: Problem with panels...
[Re: Poison]
#203940
04/25/08 06:33
04/25/08 06:33
|
Joined: Feb 2007
Posts: 53
n00bie
OP
Junior Member
|
OP
Junior Member
Joined: Feb 2007
Posts: 53
|
EDIT: solved
Last edited by n00bie; 04/25/08 07:27.
|
|
|
|
|
|