Game Development Community

echo position not returned. ( i know )

by rennie moffat · in Torque Game Builder · 05/04/2010 (12:28 pm) · 9 replies

HI, I have run into a strange problem in that a simple...

%this.thingPos = %this.thing.getPosition();
echo("%this.thingPos " @ %this.thingPos);


returns nothing. as such it prevents my behavior from working.


I Have run a million, well maybe not a million, but this came up last night and today on simple behaviors. No errors in script. Objects set in editor, named etc. Has anyone heard of this and know of a good trouble shoot?

About the author

My thanks to Garage Games and the Garage Games Community combined with owned determination I got one game up, Temple Racer and I am looking to build more interesting, fun games for the mass market of the iOS app store.


#1
05/04/2010 (2:26 pm)
You dont see the echo because the logic is not getting there.
#2
05/04/2010 (2:40 pm)
I know, which is so weird,
the behavior worked yesterday, new scene it does not. On the same note, I was creating one (a behavior) last night that would not return the logic of get position.



So strange.
#3
05/04/2010 (3:07 pm)
basic troubleshooting dictates you start at the beginning of the process, placing echo's along the way. Once you find the disconnect, mystery solved.
#4
05/04/2010 (3:12 pm)
I hears yah, but seriously, I have a behavior, all fields are seen in the editor, selected appropriately, then I have onBehaviorAdd, where i getPosition of a few items. As I say it did work, now it doesn't.


giving me a headache, or maybe it's this screen.



#5
05/04/2010 (5:35 pm)
without basic troubleshooting skills, your entire programming experience will be one major headache.
#6
05/04/2010 (6:54 pm)
no I have them, basic for sure.

its all a learning process, but to have something work, run with out error, but not call a position is what is frustrating.

no worries, I will be going over it again.

thanks.
#7
05/04/2010 (8:06 pm)
Ok, so I did some small tests and onBehaviorAdd() will not set the position of an object, which I find odd, and a bit inconvenient. I also can not get a position. Why is that? I thought I was, had been doing that. this small tests says no.




:::: not a huge deal, but a bit surprising.


#8
05/04/2010 (8:33 pm)
In order to learn something you have to make a change. Doing the same thing over and over gains you nothing.

For example, take it out of the behavior and put it into the base class. I only use behaviors for very simple functions, most everything else goes into the class (my preference).
#9
05/05/2010 (7:46 am)
hmm, see I do everything from behaviors as I "trust them more".



but no worries, as I say I think I have solved it.


Regards.