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 / user type question

Author
Message
mindsclay
12
Years of Service
User Offline
Joined: 1st May 2012
Location: Rocklin, CA, USA
Posted: 22nd Sep 2013 02:25
IN the below code I am expecting to see values '100' for .X and '110' for .Y printed to screen. But I am getting '100' and '0'. Am I trying to do something that is illegal or is it a bug?



www.mindsclay.com
lucifermagus.mindsclay.com (not working with Firefox)
Ancient Lady
Valued Member
20
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 22nd Sep 2013 03:10
First, what version of AppGameKit are you using?

I haven't seen returning a UDT from a function working so far. It is one of the things that needs fixing.

I think it sort of works if you use a global variable instead of a local variable.

In theory you should be able to declare the return type of a function, making using a UDT work. But I also have not seen that work yet, either.

Cheers,
Ancient Lady
AGK Community Tester and AppGameKit Master
Markus
Valued Member
20
Years of Service
User Offline
Joined: 10th Apr 2004
Location: Germany
Posted: 22nd Sep 2013 10:41 Edited at: 22nd Sep 2013 10:42
returnValues is not defined as node
returnValues=function1()

this works:
Ancient Lady
Valued Member
20
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 22nd Sep 2013 18:17
Good catch, Markus! I missed that one.

It is good to hear that functions now successfully return UDTs.

Cheers,
Ancient Lady
AGK Community Tester and AppGameKit Master
Digital Awakening
AGK Developer
21
Years of Service
User Offline
Joined: 27th Aug 2002
Location: Sweden
Posted: 22nd Sep 2013 18:48
UDTs and functions was fixed in beta 18 IIRC.

mindsclay
12
Years of Service
User Offline
Joined: 1st May 2012
Location: Rocklin, CA, USA
Posted: 22nd Sep 2013 19:41
I am doing that in my original code but with a different varible name. I merely forgot to add that when posting the example code.

So there must be something else. Thanks for looking.

www.mindsclay.com
lucifermagus.mindsclay.com (not working with Firefox)
mindsclay
12
Years of Service
User Offline
Joined: 1st May 2012
Location: Rocklin, CA, USA
Posted: 22nd Sep 2013 19:58
I am declaring the type in Main.agc then calling a function in a separate file which calls the function that assigns the values. (Like function1 in the example code)

Perhaps it does not work with nested functions? No. The example code works when I set it up the same way as my original code.

I guess I'll just start remarking out lines until I find the culprit.

www.mindsclay.com
lucifermagus.mindsclay.com (not working with Firefox)
mindsclay
12
Years of Service
User Offline
Joined: 1st May 2012
Location: Rocklin, CA, USA
Posted: 22nd Sep 2013 20:35
I was able to get a repeat performance using the code provided above. It was working at first, then I started adding code to re-create my original, but using the provided code above (since it was working). Then the .Y being zero happened again. So, I deleted the code that I added, but the .Y being zero still remains. This sounds like a bug to me.

I will try to re-create my exact steps, but all I did was add code, and when the code was removed the problem remained.

www.mindsclay.com
lucifermagus.mindsclay.com (not working with Firefox)
mindsclay
12
Years of Service
User Offline
Joined: 1st May 2012
Location: Rocklin, CA, USA
Posted: 22nd Sep 2013 20:40 Edited at: 22nd Sep 2013 20:53
BTW: using the latest version 1.08 19

Problem:

I was using P2 instead of P1 when assigning the values. So, P1.Y was zero instead of 110 because I was assigning P2.Y=110

DOH!

www.mindsclay.com
lucifermagus.mindsclay.com (not working with Firefox)
Ancient Lady
Valued Member
20
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 22nd Sep 2013 20:59
We all have those moments (and there really needs a 'palm-to-forehead' emoticon).

But you have it working now. And that is what counts.

Happy Programming!

Cheers,
Ancient Lady
AGK Community Tester and AppGameKit Master
mindsclay
12
Years of Service
User Offline
Joined: 1st May 2012
Location: Rocklin, CA, USA
Posted: 22nd Sep 2013 21:46
And no matter how many times I looked at it, I kept seeing P1 when it was actually P2. Therefore, I cannot trust my perception of reality.

www.mindsclay.com
lucifermagus.mindsclay.com (not working with Firefox)

Login to post a reply

Server time is: 2024-05-09 07:30:50
Your offset time is: 2024-05-09 07:30:50