I doubt it'll outdo RunUO anytime soon - but at least we're trying to make it an option for some =) By the way, it's not Java - but JavaScript - which is somewhat different
Oh, and here are two examples of how I could do your "make a guard appear" thing in UOX3's JS-engine.
In the first example, I have the serial of the painting already saved on the roast pig in the form of 4 tags called serial1, serial2, serial3 and serial4:
Code:
function onUse( pUser, iUsed )
{
var newNpcObject = SpawnNPC( "m_guard", iUsed.x, iUsed.y, iUsed.z, iUsed.worldnumber );
var painting = CalcItemFromSer( iUsed.GetTag( "serial1"), iUsed.GetTag( "serial2"), iUsed.GetTag( "serial3"), iUsed.GetTag( "serial4"));
painting.TextMessage( "Do you smell bacon?" );
}
In the second example, the painting object isn't "known" to the roast pig (serial isn't saved), so I do a search of the immediate area (radius 2 from the roast pig) to see if I find an item with the name "Sweetmusic". If a match is found, the text is spoken by the painting.
Code:
function onUse( pUser, iUsed )
{
var npcObject = SpawnNPC( "m_guard", iUsed.x, iUsed.y, iUsed.z, iUsed.worldnumber );
AreaItemFunction( "myAreaFunction", iUsed, 2, pUser.socket);
}
function AreaItemFunction( srcChar, trgItem, pSock )
{
if( trgItem.name == "Sweetmusic" )
trgItem.TextMessage( "Do you smell bacon?" );
}
When given a unique script-ID in a certain text file, the script can be assigned to the roast pig either using an ingame command, 'SETSCPTRIG <scriptID> or through a tag in the roast pig's script section; SCRIPT=<scriptID>.
How hard/easy to do does this look compared to what you did in Sphere?