Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Studio Chat / [SOLVED] problem with #Include

Author
Message
W Red
1
Years of Service
User Offline
Joined: 8th Oct 2022
Location:
Posted: 26th Oct 2022 18:09
Hello guys I have a problem connecting files to my project, I create a new resource file and write the connection command to my main project, but it does not connect, what did I do wrong?

The author of this post has marked a post as an answer.

Go to answer

haliop7
2
Years of Service
User Offline
Joined: 1st Mar 2022
Location:
Posted: 27th Oct 2022 06:27
Show us your code.
W Red
1
Years of Service
User Offline
Joined: 8th Oct 2022
Location:
Posted: 27th Oct 2022 07:58 Edited at: 28th Oct 2022 16:16
This post has been marked by the post author as the answer.


and I created a resource file where I wrote the skybox command and wrote the command to connect to the main project

do
SetSkyBoxVisible(1)
loop
Zappo
Valued Member
19
Years of Service
User Offline
Joined: 27th Oct 2004
Location: In the post
Posted: 27th Oct 2022 15:12
You cannot have two main loops like that. You are importing your "skybox.agc" file which is equivalent to inserting all of the code in that file right there in your main source code. So, it will insert the
do
SetSkyBoxVisible(1)
loop

before your main program's "do... loop" and never get passed it to continue with the rest of your code.

I would recommend using #include files for things like setting up your variables and for keeping custom functions which you call from your main program. This keeps things neat and easier to manage.
I hope that helps.
W Red
1
Years of Service
User Offline
Joined: 8th Oct 2022
Location:
Posted: 27th Oct 2022 15:54
yes it helped, thanks a lot

Login to post a reply

Server time is: 2024-05-04 00:24:57
Your offset time is: 2024-05-04 00:24:57