Page 1 of 1

oooh, I'm asking yet another usecode question.

Posted: Mon Jul 19, 2004 9:59 pm
by Mighty Dog
okay, my problem this time is with the UI_click_on_item().
its suppose to give me an array with the values of item shape, x coordinates, y coordinates, and z coordinates. well I'm getting x,y,z coordinates but no item shape. for testing purposes i set up a talking cargo hold, and set it up to tell me the first 10 values of the array.

Ships_hold 0x195 ()
{
if (event != 1)
return;

var testing123;
testing123 = UI_click_on_item();

UI_show_npc_face(1);

say(testing123[0]," ",testing123[1]," ", testing123[2],"

",testing123[3]," ",testing123[4]," ",testing123[5]," ",testing123[6],"

",testing123[7]," ",testing123[8]," ",testing123[9]);
UI_add_answer("bye");

converse
{
if (response == "bye")
{
say("Fare thee well!");
break;
}
}
}

Value 2 is the x cord, 3 is the y cord, and 4 the z cord. all others display 0 as their value.

So, does the item part of this command not work properly, am i missing something, or am i FUBAR and should be quiet with these weekly usecode questions.

Re: oooh, I'm asking yet another usecode question.

Posted: Tue Jul 20, 2004 6:31 am
by wjp
You just can't output objects with say. There's no sensible thing to output...

Re: oooh, I'm asking yet another usecode question.

Posted: Tue Jul 20, 2004 9:03 am
by drcode
A couple suggestions:

1. The first element of the array returned by UI_click_on_item is the object clicked on (if there is one). You can't print that out directly, but you can use UI_get_item_shape to get it's shape #.

2. There is a UI_printf for debugging. It works like C's printf, except, for now, only the '%s' specification is supported. You could do something like UI_printf("Obj. is %s", testing123[1]);

Re: oooh, I'm asking yet another usecode question.

Posted: Tue Jul 20, 2004 10:28 am
by Mighty Dog
ahhh, excellent. thanks for the help once again