3 registered members (AndrewAMD, Quad, 1 invisible),
721
guests, and 7
spiders. |
Key:
Admin,
Global Mod,
Mod
|
|
|
i've done everything i can think of
#275338
07/01/09 03:03
07/01/09 03:03
|
Joined: Jun 2009
Posts: 148
gamingfan101
OP
Member
|
OP
Member
Joined: Jun 2009
Posts: 148
|
hi, i finally got my menu done, for the most part. I'm trying to test the button that switches over to a seperate program. It reads it fine, but it says that there is an error in this line.
function turn_on() { set(nxthi_panel, SHOW); }
In its own program it works fine, but once its connected it doesnt. heres the other code.
PANEL* mainbutton1 = { bmap = gonorm; pos_x = 10; pos_y = 100; button (0, 0, goclicked, gonorm, goover, robotswitch, NULL, NULL); flags = OVERLAY | SHOW; }
function robotswitch() { #include"robotshowcase.c"; }
Thanks!
Sorry, im new. I have a tendency to ask really simple questions, so please be patient.
|
|
|
Re: i've done everything i can think of
[Re: gamingfan101]
#275342
07/01/09 03:41
07/01/09 03:41
|
Joined: Dec 2008
Posts: 528 Wagga, Australia
the_mehmaster
User
|
User
Joined: Dec 2008
Posts: 528
Wagga, Australia
|
#include "robotshowcase.c";
You do not need the semi-colon. It should be
#include "robotshowcase.c"
Also, this only includes the code from the program, so it probably won't work even if you get the syntax errors gone..
Last edited by the_mehmaster; 07/01/09 06:04.
|
|
|
Re: i've done everything i can think of
[Re: delinkx]
#275527
07/01/09 17:36
07/01/09 17:36
|
Joined: Jun 2009
Posts: 148
gamingfan101
OP
Member
|
OP
Member
Joined: Jun 2009
Posts: 148
|
this is probably an easy answer question, but i couldnt find it in the tutorials or AUMs, how would i call this particular function?
Sorry, im new. I have a tendency to ask really simple questions, so please be patient.
|
|
|
Re: i've done everything i can think of
[Re: gamingfan101]
#275589
07/01/09 22:37
07/01/09 22:37
|
Joined: Apr 2006
Posts: 737 Ottawa, Canada
Ottawa
User
|
User
Joined: Apr 2006
Posts: 737
Ottawa, Canada
|
Hi! By writing in your code the name of the function my_robot_function (); which is in your "robotshowcase.c" I think that the include should be at the top of your main.c file under all the other includes and not in a function. You where in fact trying to call the actions of your entity with the include That's not the way to do it. You have to call the name of the function
Hope this helps! Ottawa Ver 7.86.2 Pro and Lite-C
|
|
|
Re: i've done everything i can think of
[Re: Ottawa]
#275608
07/02/09 00:24
07/02/09 00:24
|
Joined: Jun 2009
Posts: 148
gamingfan101
OP
Member
|
OP
Member
Joined: Jun 2009
Posts: 148
|
Ok, i added the include to the top, and heres the code to call it, what should go in the place of the ???.
function robotswitch() { while (key_any) {wait (1); } ?????????????? }
i tried what i thought should go there, but it didnt work.
Sorry, im new. I have a tendency to ask really simple questions, so please be patient.
|
|
|
Re: i've done everything i can think of
[Re: gamingfan101]
#275641
07/02/09 04:03
07/02/09 04:03
|
Joined: Jun 2009
Posts: 148
gamingfan101
OP
Member
|
OP
Member
Joined: Jun 2009
Posts: 148
|
wouldnt the code be something like this?
function robotswitch() { while (key_any) {wait(1);} goto(robotshowcase.c); }
Please help
Sorry, im new. I have a tendency to ask really simple questions, so please be patient.
|
|
|
Re: i've done everything i can think of
[Re: gamingfan101]
#275764
07/02/09 10:28
07/02/09 10:28
|
Joined: Jul 2008
Posts: 1,178 England
MrGuest
Serious User
|
Serious User
Joined: Jul 2008
Posts: 1,178
England
|
heya
#include"robotshowcase.c";
function turn_on()
{
set(nxthi_panel, SHOW);
}
PANEL* mainbutton1 =
{
bmap = gonorm;
pos_x = 10;
pos_y = 100;
button (0, 0, goclicked, gonorm, goover, robotswitch, NULL, NULL);
flags = OVERLAY | SHOW;
}
function robotswitch(var button_no, PANEL* panel_id)
{
while(key_any){wait(1);}
beep();
turn_on();// display next panel? if that's what you're attempting
}
hope this helps
|
|
|
Re: i've done everything i can think of
[Re: MrGuest]
#275893
07/02/09 17:10
07/02/09 17:10
|
Joined: Jun 2009
Posts: 148
gamingfan101
OP
Member
|
OP
Member
Joined: Jun 2009
Posts: 148
|
no, what im trying to do is switch to another program completely.
Sorry, im new. I have a tendency to ask really simple questions, so please be patient.
|
|
|
Re: i've done everything i can think of
[Re: gamingfan101]
#275930
07/02/09 20:03
07/02/09 20:03
|
Joined: Apr 2006
Posts: 737 Ottawa, Canada
Ottawa
User
|
User
Joined: Apr 2006
Posts: 737
Ottawa, Canada
|
Hi!
so your : goto(robotshowcase.c); is not the correct way to do it. You never call a .c file this way...you use #include which you have already done.
Now what you will have to do if you want to change levels is to call a level_load or call the starting function
Is robotshowcase.c another level ?
Hope this helps! Ottawa Ver 7.86.2 Pro and Lite-C
|
|
|
|