Help understanding si_path_run_usecode
Posted: Wed Nov 21, 2007 2:06 pm
As I keep fiddling around with more and more usecode I keep running into things I don't quite understand. The current one being the breakdown of si_path_run_usecode.
My understanding is it will path the avatar/npc to the location given and execute the function that is given.
However, I don't quite understand a couple of the values in the intrinsic.
UI_si_path_run_usecode(actor npc, int pos[], int event, object obj, function fun, bool flag)
What is an event ID and the object obj?
I've been trying to make the avatar walk up to a chimney when it's double clicked on using this intrinsic, by getting the location of it when it is clicked on, and having the avatar approach it and say something like "This is a chimney".
If my function to use when the avatar reaches the destination is called AvatarSpeak, I would start to fill in the instrinsic thusly:
UI_si_path_run_usecode(AVATAR, [loc[1], loc[2], loc[3]], ???, ???, AvatarSpeak, true)
Which, whether or not the avatar reaches the position or not would still run AvatarSpeak (due to the flag being True).
However, I'm not sure what I'm supposed to put in where the ??? are.
Is the object obj supposed to be the item that was double clicked (in this example the chimney) or something else entirely?
Thanks
My understanding is it will path the avatar/npc to the location given and execute the function that is given.
However, I don't quite understand a couple of the values in the intrinsic.
UI_si_path_run_usecode(actor npc, int pos[], int event, object obj, function fun, bool flag)
What is an event ID and the object obj?
I've been trying to make the avatar walk up to a chimney when it's double clicked on using this intrinsic, by getting the location of it when it is clicked on, and having the avatar approach it and say something like "This is a chimney".
If my function to use when the avatar reaches the destination is called AvatarSpeak, I would start to fill in the instrinsic thusly:
UI_si_path_run_usecode(AVATAR, [loc[1], loc[2], loc[3]], ???, ???, AvatarSpeak, true)
Which, whether or not the avatar reaches the position or not would still run AvatarSpeak (due to the flag being True).
However, I'm not sure what I'm supposed to put in where the ??? are.
Is the object obj supposed to be the item that was double clicked (in this example the chimney) or something else entirely?
Thanks