Ryandor.com https://ryandor.com/forum/ |
|
Scriptable packet-handling coming to UOX3 https://ryandor.com/forum/viewtopic.php?f=4&t=2567 |
Page 1 of 1 |
Author: | Xuri [ Thu Nov 03, 2005 5:06 pm ] |
Post subject: | Scriptable packet-handling coming to UOX3 |
giwo is in the process of adding support for packet handling through UOX3's JS-engine (making it scriptable), and any questions, comments, thoughts or suggestions for what should be included would be most welcome ![]() http://www.uox3.org/forum/viewtopic.php?t=653 |
Author: | Sydius [ Thu Nov 03, 2005 5:13 pm ] |
Post subject: | |
Blatant advertising! ![]() |
Author: | Xuri [ Thu Nov 03, 2005 5:38 pm ] |
Post subject: | |
Are you implying something? ![]() |
Author: | Dev Viperrious [ Thu Nov 03, 2005 6:22 pm ] |
Post subject: | |
Ooo UOX might out do RUNUO very shortly it sounds like. Not that I like Java (mostly because I'm clueless about it) but the being scriptable by mear mortals again is appealing over the dreaded C# which is way to complicated and to boring to learn just to make a guard appear everytime you double click the roast pig and make the painting above it say "Do you smell bacon?". Yes I did script that into the first world file I did for Sphere in 1999. Which is the one they give away for the 55i btw... Just for fun search it for "Sweetmusic" (The name of the painting over the roast pig) and "This is what you get for saying my world sucks" (the head laying on the floor in Britain gravy yard (yeah I know its spelled wrong but PK's used to clean house there). ![]() Dev |
Author: | Xuri [ Thu Nov 03, 2005 7:46 pm ] |
Post subject: | |
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? |
Page 1 of 1 | All times are UTC - 7 hours [ DST ] |
Powered by phpBB® Forum Software © phpBB Group http://www.phpbb.com/ |