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 Classic Chat / issues loading media in the beta...

Author
Message
Mobiius
Valued Member
21
Years of Service
User Offline
Joined: 27th Feb 2003
Location: The Cold North
Posted: 21st Dec 2012 10:33 Edited at: 21st Dec 2012 10:36
I feel like such a noob, but for some reason I'm unable to load anything from my media folders. (Or in fact, anything which should be created with the write commands)

My folder structure is as follows:
<root> (Which contains the .exe file)
\ <media> (Which contains all resource folders)
|\<textures> (Which contains my textures )

If I load an image like so: Img = LoadImage( "textures/image.png" ) Like in previous versions, my error trapping code is triggered saying it cant find the image.

Has the default location been changed?? Likewise, what about accessing files with the read and write commands?? I'm having no luck with previously working programs there either!


*edit* If I load the image like so: Img = LoadImage( "/textures/image.png" ) ((note the leading slash)) then AppGameKit complains that it 'failed to load image'
This is an AppGameKit error, which means my own error trapping code has succeeded meaning AppGameKit found the image!
WTF am I doing wrong!!! lol

I live for video games! (And beers, and football, and cars!)
See what I live for here: [url]http:\\www.TeamDefiant.co.uk[/url]
baxslash
Valued Member
Bronze Codemaster
17
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 21st Dec 2012 10:53
I can't see anything wrong with your code assuming you don't change the default folder using "setFolder()".

Could it be a problem with the image? Or maybe a dodgy install? Did you fully uninstall the previous version before installing the Beta?

Can you upload a sample project?


this.mess = abs(sin(times#))
Mobiius
Valued Member
21
Years of Service
User Offline
Joined: 27th Feb 2003
Location: The Cold North
Posted: 21st Dec 2012 11:14
It's a clean install on a brand new laptop. As for the image, it won't load any image, even previously working images.

As for sample code, behold:



I live for video games! (And beers, and football, and cars!)
See what I live for here: [url]http:\\www.TeamDefiant.co.uk[/url]
baxslash
Valued Member
Bronze Codemaster
17
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 21st Dec 2012 11:40
Lower$ is wrong, it doesn't need the $ like DBPro.

If I changed that and then changed the "If Not" line as below it worked fine.


It's not generally good practice to check for or load a lowercase version of a filename as some platforms (such as Android) are highly case sensitive.


this.mess = abs(sin(times#))
Mobiius
Valued Member
21
Years of Service
User Offline
Joined: 27th Feb 2003
Location: The Cold North
Posted: 21st Dec 2012 15:17 Edited at: 21st Dec 2012 15:21
Quote: "Lower$ is wrong, it doesn't need the $ like DBPro."
Turns out I have a Lower$ function as early AppGameKit didn't have it.

Quote: "It's not generally good practice to check for or load a lowercase version of a filename as some platforms (such as Android) are highly case sensitive."
ALL my media is lowercase for exactly this reason.

As for your suggested fix, it didn't work for me. It triggers both my error checking code, and an AppGameKit error.

Have they changed the default locations for T1 media? Do I have to explicitly reference the media folder, or just what's in it? (Or is this a stupid windows 8 issue??)

Why does it suddenly not work when it all worked fine before I got this new laptop.




*EDIT*
Solved it. I had to include "/media/rest of path" and it worked. This is an annoying change....

I live for video games! (And beers, and football, and cars!)
See what I live for here: [url]http:\\www.TeamDefiant.co.uk[/url]
baxslash
Valued Member
Bronze Codemaster
17
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 21st Dec 2012 15:29
I just tried it on my own Windows 8 machine and get the same error.

I haven't been able to get around it yet but oddly my own app in W8 didn't have this problem...


this.mess = abs(sin(times#))
Ancient Lady
Valued Member
20
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 21st Dec 2012 16:07
Yup, if you are going to specify a path, in Tier 1, it must start with '/media/...' and that first forward slash is very important.

Cheers,
Ancient Lady
AGK Community Tester and AppGameKit Master
baxslash
Valued Member
Bronze Codemaster
17
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 21st Dec 2012 16:08
Could have sworn I tried that...


this.mess = abs(sin(times#))
Ancient Lady
Valued Member
20
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 21st Dec 2012 16:12
baxslash, do you mean that you are doing it ('/media/..') or that you are commenting on my comment (meant to be for Mobiius)?

I make it a habit to always specify '/media/<whatever' all the time just to be sure. Even in my Tier 2 work. I put all of my media related files in <project>/Final/media just to make organisation easier.

Cheers,
Ancient Lady
AGK Community Tester and AppGameKit Master
baxslash
Valued Member
Bronze Codemaster
17
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 21st Dec 2012 16:22
I mean I thought I tried doing it "/media/..".

I also placed a file in the media folder and tried loading it directly with no sub-folders involved and it wouldn't load. I think I'll take another look later.


this.mess = abs(sin(times#))
Mobiius
Valued Member
21
Years of Service
User Offline
Joined: 27th Feb 2003
Location: The Cold North
Posted: 21st Dec 2012 17:17
It must be a combination of the latest beta and windows 8, as I didn't have this problem on my windows 7 machine when I had it.

I live for video games! (And beers, and football, and cars!)
See what I live for here: [url]http:\\www.TeamDefiant.co.uk[/url]
Ancient Lady
Valued Member
20
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 21st Dec 2012 17:23
That figures. I probably won't worry about producing for Windows at all at this stage. I haven't seen anyone say they make big bucks doing it.

Cheers,
Ancient Lady
AGK Community Tester and AppGameKit Master

Login to post a reply

Server time is: 2024-11-24 03:43:33
Your offset time is: 2024-11-24 03:43:33