Gamestudio Links
Zorro Links
Newest Posts
Trading Journey
by howardR. 04/28/24 09:55
basik85278
by basik85278. 04/28/24 08:56
Zorro Trader GPT
by TipmyPip. 04/27/24 13:50
Help with plotting multiple ZigZag
by M_D. 04/26/24 20:03
Data from CSV not parsed correctly
by jcl. 04/26/24 11:18
M1 Oversampling
by jcl. 04/26/24 11:12
Why Zorro supports up to 72 cores?
by jcl. 04/26/24 11:09
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
2 registered members (AndrewAMD, NeoDumont), 761 guests, and 1 spider.
Key: Admin, Global Mod, Mod
Newest Members
wandaluciaia, Mega_Rod, EternallyCurious, howardR, 11honza11
19049 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 1 of 5 1 2 3 4 5
i've done everything i can think of #275338
07/01/09 03:03
07/01/09 03:03
Joined: Jun 2009
Posts: 148
G
gamingfan101 Offline OP
Member
gamingfan101  Offline OP
Member
G

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 Offline
User
the_mehmaster  Offline
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: the_mehmaster] #275355
07/01/09 05:54
07/01/09 05:54
Joined: Jul 2008
Posts: 553
Singapore
delinkx Offline
User
delinkx  Offline
User

Joined: Jul 2008
Posts: 553
Singapore
after including the code. u need to call the particular function from that .c file.


A7 commercial Team / VC++ 2008 Pro
homepage | twitter | facebook
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
G
gamingfan101 Offline OP
Member
gamingfan101  Offline OP
Member
G

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
O
Ottawa Offline
User
Ottawa  Offline
User
O

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 wink


Hope this helps!
Ottawa laugh

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
G
gamingfan101 Offline OP
Member
gamingfan101  Offline OP
Member
G

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
G
gamingfan101 Offline OP
Member
gamingfan101  Offline OP
Member
G

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
M
MrGuest Offline
Serious User
MrGuest  Offline
Serious User
M

Joined: Jul 2008
Posts: 1,178
England
heya
Code:
#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
G
gamingfan101 Offline OP
Member
gamingfan101  Offline OP
Member
G

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
O
Ottawa Offline
User
Ottawa  Offline
User
O

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 laugh

Ver 7.86.2 Pro and Lite-C
Page 1 of 5 1 2 3 4 5

Moderated by  HeelX, Lukas, rayp, Rei_Ayanami, Superku, Tobias, TWO, VeT 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1