Page 1 of 1

something on usecode eggs

Posted: Mon Sep 10, 2007 12:11 pm
by Donfrow
First off, sorry for yet another dumb question.

I understand how something on works for the usecode eggs, and have it working so when I put any object on the avatar will say "Test".

How do you determine what shape# is put on a usecode egg? Like the banes gems put on the proper shrines. I figure it has something to do with get_item_quality, get_item_frame and get_item_shape but I cannot figure out how to tell it what item to get this information from.

I checked the intrinsic list but did not see something that gets the item shape from a general area, so hopefully I didn't just miss it.

Thanks

Re: something on usecode eggs

Posted: Mon Sep 10, 2007 6:27 pm
by marzo
You can see a working example here. The first function is used to detect the lenses when you are going to see the Codex; the eggs are set to activate when something is 'on' them.

Re: something on usecode eggs

Posted: Tue Sep 11, 2007 6:51 am
by Donfrow
Blah of course I missed the intrinsic in the list. Sigh.

I seem to have it working for any object when something is on, but I can't seem to make it work with the specified shape. I tried to make it similar to yours just with different variables. It's set to 'something on' in the egg.

egg_something_on_test()
{
var loc = UI_get_object_position();
var object;

object = loc->find_nearby(BUCKLER, 1, MASK_NONE);


if (object)
{
AVATAR.say("Correct item");
}
else
{
AVATAR.say("Not correct item");
}
}

I know it's sort of working since it will hit the "Not correct item" but it is never finding the buckler as the correct item. Even when I put the buckler on it still is coming to the "Not correct item". The buckler shape constant is also correct. The only difference I can see is that yours starts off with it being if event == egg or scripted but that should not make a difference if I understand correctly.

I'm really sorry about missing the intrinsic too.

Re: something on usecode eggs

Posted: Tue Sep 11, 2007 6:55 am
by Donfrow
I will mention I also tried to use find_nearest and find_object to no avail as well.