Various Questions

Forum where anything UOX3-related goes - including, but not limited to: newbie-support, ideas, general questions, comments, etc and-so-forth.
Post Reply
Hughesbuddy
UOX3 Newbie
Posts: 21
Joined: Fri Apr 22, 2022 3:07 am
Has thanked: 0
Been thanked: 2 times

Various Questions

Post by Hughesbuddy »

Sorry for the vagueness, just looking for a few things and wondering how best to go about it.

1. One of the things that's annoying me is that shopkeep NPC's names are simply their random Gen'd name and not "(Name) (Title)", running through towns a user is unfamiliar with is really frustrating not knowing what the NPC's actually are. In OSI (LBTR at least) vendor names went that way so i was looking to try and mimic this. I've found the Spawners triggering spawns of the Shopkeepers, i've found the NPC dfn's pointing to the NPC Namelist's, but how can i combine the NPC Namelist Generated name along with the title into a single Name? I thought it would be straightforward to find the code that actually "does" the creation of the new NPC and i would simply add Name and Title together, but I can't for the life of me find it, is it buried in one of the original .C files from pre-compile? Or is there a better way to do this via the dfn files?

2. There seems to be a lot of the autogenerated world that is either missing or not accurate (how i remember it at least), and of course half the fun is recreating things so i'm not knocking the auto-generated spawn content at all, but i was wondering, since all of he spawn regions are coordinate based i know i can simply say 'where to get my current coordinates, but could i get that to always show in a toolbar or somewhere? Or even better, ideally it would be awesome to see the bounding boxes for spawn regions on the map as an outline (Probably not easy to do, but it would be cool..). Thoughts on a best way to do this? I guess i could just macro the command and spam it as i run, but curious if there was a better way to visualize the spawn regions or if it's just like using a sextant and treasure hunting..

3. Also, along the same lines, before i go modifying the spawn regions, am i correct in viewing things that those x1 y1 coordinates are the bounding boxes for the top left and bottom right corners of the spawn region? Although this probably equates to the top and bottom corners since it's isometric, right? For multiple x1,y1's in a spawnregion, is it doing like a polygon-connect the dots sort of region?

Forgive me if any of this is in the documentation, i've been looking for a lot of stuff, it's just a lot to pour over, i'll go back there if any of this is covered already in it. Probably it for now, I need to clean up destard, i walked in and it was a white wyrm and an ancient wyrm first thing in the door.. hahaha.
User avatar
Xuri
Site Admin
Posts: 3704
Joined: Mon Jun 02, 2003 9:11 am
Location: Norway
Has thanked: 48 times
Been thanked: 8 times
Contact:

Post by Xuri »

No worries!

For your first question, just to clarify, is your goal to display the combined NPC name and title overhead, like... "Roger the Blacksmith"? If so, you can look for the following function in cSocket.cpp:
void CSocket::ShowCharName( CChar *i, bool showSer )
There, you can throw in the following (snippet right before the if statement):
if( i->IsNpc() )
{
    charName += " " + i->GetTitle();
}

if(cwmWorldState->ServerData()->UseUnicodeMessages())
[...snip...]
I haven't actually tested the above snippet, but it should in theory work ^^; Also, this could actually be an INI option hmm. Maybe I'll make it one!

For your second question - yeah the default spawns we have don't match up very well with the actual state of UO from back then. There's currently a PR on GitHub that contains a great effort by DragonSlayer to rectify that, which should be much more accurate. Real life has prevented me from doing proper testing and merging the PR, but it should be good to use. So before you start changing spawn regions yourself, I suggest having a look at that first!

Concerning visualizing the spawn regions, we used to have multiple tools for both displaying and editing spawn regions, but they were all written for older versions of UOX3 and might no longer be compatible with changes that have been made since then (such as support for multiple spawn DFN files, as done in the GitHub update I mentioned above). It might still be able to display spawn regions for individual files at a time, though. If you want to give it a try, I posted a link to it in an older thread. Otherwise, you'll need to just rely on manual updates for now unless someone takes it upon themselves to create a new tool for this. :X

I also saw some efforts in the ClassicUO community to display similar zones for other emulators overlaid on the worldmap in the client itself, so maybe there could be a similar way to do it for UOX3 as well - but probably not in an automatic way (like sent from server), but would need to be added to the client files manually. The same CUO client also displays your current coordinates in the top left corner of its world map, btw, which is continuously updated as you run around:
cuo_map_coords.jpg
cuo_map_coords.jpg (17.96 KiB) Viewed 7264 times
Finally, regarding your question about spawn region setup - your assumption about X1 Y1 and X2 Y2 is correct; they are the top left (north-west) and bottom right (south east) corners of a specific spawn region. Note that the while the region system (dfndata/regions) can handle multiple such pairs of coordinates to form a larger, combined shape for a region, the spawn region system only allows for single set of coordinates per spawn region.
These users thanked the author Xuri for the post:
Nozgo
-= Ho Eyo He Hum =-
Hughesbuddy
UOX3 Newbie
Posts: 21
Joined: Fri Apr 22, 2022 3:07 am
Has thanked: 0
Been thanked: 2 times

Post by Hughesbuddy »

Great, yes that was my plan for the vendor names doing +=, just never would have thought to look for a cSocket.cpp file.. Is there a general outline of the various .cpp files and what they handle floating around? Most are named well enough, but i would not have known cSocket..

The Spawn updates looks good, i'm not very familiar with git (i know right?) i dinked around trying to figure out how to download the files for a pull request and couldnt figure out how.. so i manually downloaded the files one at a time, uggg.. But i put them in and i'll look around, thanks for the info.

Good info on the coordinate stuff as well. I'll test this when i can, but for now, i have another problem with out_of_range, but i'll update the previous post.. Thanks!
User avatar
Xuri
Site Admin
Posts: 3704
Joined: Mon Jun 02, 2003 9:11 am
Location: Norway
Has thanked: 48 times
Been thanked: 8 times
Contact:

Post by Xuri »

Ah... ^^; if you go directly to the branch of the PR (Ex: https://github.com/DragonSlayer62/UOX3/tree/spawnregions), you can click the green "Code" button and "Download zip" to grab everything in the repo in one zip file :P

There doesn't exist a good overview of the different files, unfortunately. It's probably something we should add hm.
-= Ho Eyo He Hum =-
Post Reply