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 / weird bug on error reporting

Author
Message
Phaelax
DBPro Master
21
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 11th Jun 2013 00:02 Edited at: 11th Jun 2013 00:03
I got the line number correct, however I haven't a clue what's causing the error. It's complaining about a parameter mismatch for a function that isn't being called here (or anywhere inside the updateCharPosition function) nor even in this source file. The xml function is in another file which is included at the top of my program and all works fine if I comment line 91 out.





_monk is an instance of PlayerProperties UDT and the function returns that UDT. I've returned UDTs from functions in AppGameKit before, so I don't know what the issue is.

Attachments

Login to view attachments
Phaelax
DBPro Master
21
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 11th Jun 2013 00:10 Edited at: 11th Jun 2013 01:03
I edited the update function to not return anything and now I get another error (same line number):

Parameter for 'getGID' do not match 'float' at line 91.

Inside updateCharPosition() I make several calls to getGID() which looks like this:




I've removed all code inside the function so I'm left with nothing but the function declaration really and still get the same error. I'm passing floats into it, this makes no sense and it's wasting a lot of my time now.



Ok, I've removed any call to getGID() completely and even renamed the function itself. Same error. Removed the function from code, now I just get the same parameter error on the next function below it. WTF





So what's the rules for defining UDTs in separate files? I've put several UDT definitions in a separate file and include. And usually it works perfectly fine, or has so in the past. My TMX importer is a separate file and defines the UDTs it uses inside its file and it works when included in any of my programs. However, attempting to put my PlayerProperties inside a separate file is what's causing the weird error mentioned above (which makes literally no sense at all).

swissolo
14
Years of Service
User Offline
Joined: 9th Jan 2010
Location:
Posted: 12th Jun 2013 04:06
It's quite possible you have a simple typo beforehand that isn't throwing the error it should be and is causing problems along the way. This used to happen to me frequently in AGK. It usually occurs when you have multible things going on in one line.

swis
Joined: Tue Dec 16th 2008
Interstellar
Phaelax
DBPro Master
21
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 12th Jun 2013 18:21
The problem was being caused by having my UDT contained in a separate include file. If I removed it and placed it at the top of my main program then I had no more errors. Which doesn't make sense since I've included my data types that way before without any problems.

swissolo
14
Years of Service
User Offline
Joined: 9th Jan 2010
Location:
Posted: 12th Jun 2013 18:38
hmmm alright good to know. I've avoided separate files and just stuck with 1 bulky one due to odd problems such as that.

swis
Joined: Tue Dec 16th 2008
Interstellar
Ancient Lady
Valued Member
20
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 12th Jun 2013 19:13
Phaelax, when I was working with Tier 1 and multiple files, I put the UDT definitions (for each type of object as relates to my game) in separate files and they were all included as the first ones in the main.agc file. Then I put the functional stuff in other files.

In that way all of the UDT definitions were nailed down before anything tried to use them.

Having said that, working with UDTs in arrays (in v1076) tended to have issues. I haven't tested v10812 or v10813 to see if those issues have cleared up.

Cheers,
Ancient Lady
AGK Community Tester and AppGameKit Master

Login to post a reply

Server time is: 2024-04-27 15:59:36
Your offset time is: 2024-04-27 15:59:36