Game Development Community

DynamicFields problem

by Eric Schwegler · in Torque Game Builder · 07/11/2007 (3:59 pm) · 4 replies

Hi there
after bringing my project to TGB1.5 something strange happened.

When the mouse is moved, it does a pickpoint at its current location and returns %unit, if there is an animatedsprite at that position. Then it should return %unit.player, which is a Dynamic Field set in the levelbuilder. this used to work just fine before 1.5.
Now, echo(%unit.player) returns nothing if asked for in that manner (the same happens with any other Fields). If I use echo(1234.player) in the console though it returns the Value that was set. (where 1234 is the %unit value(ID) given by above pickpoint method)

Is there some problem with the PickPoint method, or did something in that area change with the new release that might cause this?

thanks in advance

#1
07/11/2007 (4:21 pm)
Is pickPoint possibly returning more than one ID and then looking for the player field on the wrong object?
#2
07/11/2007 (11:27 pm)
No, I think thats not the problem, because the funny thing is the following :

the code states
echo(%unit SPC %unit.player)

when I look in the console I get
1234
(something like that, only one ID) and thats all.

But When I then use
echo(1234.player) in the console it returns the value (1 or 2) for the given Unit.
#3
07/12/2007 (8:08 am)
"PickPoint" returns a vector. Are you sure there isn't any whitespace? I'd recommend something like "Echo(GetWord(PickPoint(...), 0).Player);" to make sure you're getting the first object ID. That's a strange bug. PickPoint works fine. I don't think it's the cause of your problems.
#4
07/12/2007 (3:54 pm)
It works :)
Thank you very much, for the tip. It is strange though, because the pickpoint returns only that single Unit ID, but only if I use the getWord it also takes that ID to look for the Fields. (Its also very strange that it worked in the tgb version i was working with before)
Anyway, thank you both for your help

cheers