Page 1 of 1

Decorate the facets (realms) with this set of files.

Posted: Tue Jul 18, 2017 11:58 am
by Yukiko
For the past 2 weeks or so I have been working on a project, "Decorate the facets".

This started with the discovery of some cfg files in the ServUO repo. They appeared to be a complete list of all items that should be present in a fully decorated UO server. In their current format the files either required a custom parser to utilise them or reformatting to make them POL config compliant. Shame on those ServUO developers for not using POL's config file format! So I reformatted them.

Anyway, I completed the reformatting of the files up to the Mondain's Legacy expansion and wrote a program (script) to place them in the world. After running the script, to my dismay, I found out that not all doors are included in the cfg files. There might be other decorations that are missing but the doors were the most obvious. For example the blacksmith's shop in West Britain is missing doors. So one of our forum contributors, ThisIsMe, exported the doors, lights, and signs from a ServUO server to supplement my work. So now I believe all the doors are present.

I am contributing this package to the community along with some additional support scripts. As POL currently has no way to insert an item into its internal statics file, the placed items do add about 12 megabytes to the world data file (items.txt). I place on each item a CProp called "Permanent" that will prevent a modified 'destroy' command from destroying the item. I am including the modified destroy command scripts as well as an "ultimate destroy" command. I recommend replacing the regular destroy commands with the modified destroy commands. They are usually only available to GMs. This way you can prevent a GM from accidentally, or purposefully, destroying the world decorations. The ultimate destroy commands should be for developer use only and placed in the appropriate directory.

I am including my itemdesc.cfg files for both doors and bookshelves as I have added additional doors and bookshelves that were not defined in my version of the scripts. Your server might have them defined but if not you can use my files to help you upgrade.

I also created a cliloc package to look-up cliloc references because the cfg files occasionally use a cliloc reference to name an item. POL doesn't currently have a way to directly access the client's cliloc files. I exported the English cliloc file and that is included in my cliloc package. You pass the cliloc number to a function and it returns the cliloc string corresponding to the number. To keep the size of the package to a minimum I've only included the English clilocs. As currently written my decorate scripts name the item using the cliloc string if that's what the config file calls for. I didn't look into modifying the Mega cliloc package to see if it could be modified to retrieve a cliloc string and present that as the name of the item. I probably should have to be fair to our non-English speaking friends but to be honest this project has consumed all my free time for the last fortnight.

As I stated this decoration package is compliant up to the Mondain's Legacy expansion. After Mondain's Legacy there were some fairly significant map changes, especially to Magincia, that involved terrain changes that make this decoration package incompatible with newer maps. You can remove any cfg file that is named Magincia and that will probably resolve that issue atleast. I plan on converting the Stygian Abyss and Time of Legends cfg files later. I don't have a Stygian Abyss version of UO but I do have ToL so I can atleast test them out on ToL.

The "initFacets" command is used to invoke the process of placing the items in the realms. Oh yes, I forgot to mention that this decorates all realms up to and including one sign in Termur. I have not yet converted the other items for Termur. The script reads in the files and, before placing the item, checks for an existing static or dynamic item of the same ObjType at the location to avoid duplication. It appears that ServUO places statics on initialisation of the server and doesn't use the client side statics.mul files. So they include both Static and regular items in these cfg files. As I mentioned before POL has no way to dynamically add statics from scripts but prebuilds its internal statics files via uoconvert. ServUO appears to build its internal statics files on server initialisation. Anyway, after placing the item it is named and coloured if those properties are present. Bookshelves that spawn books are not initialised. I commented out the book spawn initialisation section because there are probably ten different ways that can be done. You will have to check for compatibility with your book spawner and make any changes needed. See the script initFacets.src for the commented book spawn info.

Keep in mind that this is intended for an empty world. It is compatible with Mondain's Legacy maps. It is submitted as-is with no guarantees either expressed or implied as to its functionality. I've tested it on an empty server and it worked for me but I didn't check everywhere on every map so there might be glitches or misplaced items. I would appreciate feedback. If you do find problems with misplaced items please provide the following info so I ca attempt to correct the problem: the realm (facet) the item(s) are in, the coordinates of the misplaced item(s) and any other info that can assist me in fixing the problem (facing is wrong, wrong item etc.).

Remember the two itemdesc files are for reference purposes only for use in adding any missing items to your server. Do not replace your existing files with the ones provided.

For those who might need them I have UOP files for Felucca and Trammel with the Mondain's Legacy maps. Just send me a PM if you need them.

A special thanks to ThisIsMe for his help and suggestions and to Nando for his encouragement during my "This is so frustrating. I don't know if it's worth it." phase.

I apologise for the somewhat sloppy code. I was so long in creating this that I just wanted to get it done.

I guess that's about it.

So here's the files:

Re: Decorate the facets (realms) with this set of files.

Posted: Tue Jul 18, 2017 12:09 pm
by Yukiko
I forgot to mention the function, should you wish to use it, in the clilocs.inc file used to retrieve a cliloc's text. It is CL_GetCliloc(cliloc_number). Just pass it a cliloc number to receive the text message associated to the number.

Re: Decorate the facets (realms) with this set of files.

Posted: Tue Jul 18, 2017 12:17 pm
by Yukiko
One more thing, system teleporters are not included and items in dungeons and elsewhere that are triggers such as switches and secret doors either aren't included or may not work. They require scripts and CProps. Most of my source cfg files didn't have CProp info and the one that did I chose not to pass CProps along.

Re: Decorate the facets (realms) with this set of files.

Posted: Tue Jul 18, 2017 8:27 pm
by DevGIB
So this is the secret project?
Good work Yukiko this will certainly help with potential Distro change and making sure we can offer an out of the box experience for new comers.

If not too hard maybe Boberski could get one of the test servers up and running with these so we can look/help with missing items.

If there is anything i can do to help with this or any other future projects please don't hesitate to let me know.

Re: Decorate the facets (realms) with this set of files.

Posted: Tue Jul 18, 2017 9:57 pm
by Yukiko
Thanks DefGIB! One of my secret projects. :)
I call them "get POL up and running easier" projects.
I am planning on adding this to the Distro. I may as well say it here. I am planning on ending the poll early since we've had no "no" votes, which surprises me but then again we have such a small active community. I'm working through some "real life" issues too but I hope to get started adding some other things to the Distro and I will certainly take you up on your offer.

Re: Decorate the facets (realms) with this set of files.

Posted: Tue Jul 18, 2017 10:17 pm
by boberski
Great stuff Kiko! You should include it in distro :)

Re: Decorate the facets (realms) with this set of files.

Posted: Wed Jul 19, 2017 12:18 pm
by Yukiko
I am going to. I had a pretty rough day yesterday but I did get the additional doors added to my local copy of the Distro-Alt. I will probably get this added and committed to the repo later today.