• New Horizons on Maelstrom
    Maelstrom New Horizons


    Visit our website www.piratehorizons.com to quickly find download links for the newest versions of our New Horizons mods Beyond New Horizons and Maelstrom New Horizons!

Fixed Characters Sitting in Wrong Tavern Spots

pedrwyth

Privateer
Storm Modder
@pedrwyth did some large rewrites of the relevant code to prevent weirdness a while ago.
I guess I didn't get them all - or created some.



* Gambling - Sometimes when I gamble with someone, I sit right beside them when I'm supposed to sit infront of them (table is empty too). Another case where I accepted a game and I sat in another table far across from the table I chose to play, and when I finished game, my position resumed to where I first asked to play.

The sit alongside could happen if the preferred sit position opposite was occupied -but with the table empty is definitely wrong. Any idea which tavern(s) this was - the same tavern layout is called for several taverns.

For the other there seemed to be a default which could sit you at the "nearest" free sit locator which might be at another table in the tavern - this would be for taverns with no hardcoded solution. Was the table with the gambler full in this case - and again which tavern?

A saved game in the tavern would be useful when it next happens (can be after it happens because the behaviour should repeat).

In the meantime i'll try to work back through the code and testing to find the "sit alongside when space in front " problem for myself.
 
I guess I didn't get them all - or created some.





The sit alongside could happen if the preferred sit position opposite was occupied -but with the table empty is definitely wrong. Any idea which tavern(s) this was - the same tavern layout is called for several taverns.

For the other there seemed to be a default which could sit you at the "nearest" free sit locator which might be at another table in the tavern - this would be for taverns with no hardcoded solution. Was the table with the gambler full in this case - and again which tavern?

A saved game in the tavern would be useful when it next happens (can be after it happens because the behaviour should repeat).

In the meantime i'll try to work back through the code and testing to find the "sit alongside when space in front " problem for myself.
wouldn't it be easier to determine which locator needs to be "locked" for the gambler (or even do it manually) and just make sure noone sits there?
 
* Gambling - Sometimes when I gamble with someone, I sit right beside them when I'm supposed to sit infront of them (table is empty too). Another case where I accepted a game and I sat in another table far across from the table I chose to play, and when I finished game, my position resumed to where I first asked to play.

by @A.H
 
  • Like
Reactions: A.H
wouldn't it be easier to determine which locator needs to be "locked" for the gambler (or even do it manually) and just make sure noone sits there?

It may well be better visually as well as an easier and less code solution - if I knew how to do that (and presumably release the locator when needed - or is there an override to force PChar there) -which I don't (is it just a reload disable? where would it be applied?). The hard code generally has two possible gambler positions so two locators to lock, I don't know what impact locking them may have on characters elsewhere in the game :unsure So you're welcome to do it / let me know.

I also don't know (amongst many other things) how any more random Gambler/Drinker (it's effectively the same guy who can then be either depending on chance) location is chosen to stop them occupying the last seat at a table.

If @A.H 's examples are at non hardcoded taverns (although I'm assuming for now it's not) then it could just be the habitue derived locator setting the player there.

Still at least it doesn't crash the game anymore.
 
Did any of the above happen to use in Havana by any chance?
 
wouldn't it be easier to determine which locator needs to be "locked" for the gambler (or even do it manually) and just make sure noone sits there?

Here's a thought to simplify this as suggested. Since the opposite sit locators are hard coded I could just change their type (in the model locator file and where called in quests_common.c) to be locators that the program won't use for random characters ("candles" for example) My test for Havana shows the player can then be put there with impunity. The only drawback I can see is if those particular locators have been chosen for quest characters - but the compile log should show the problem and they could be simply put on another seat.

From memory it would be two locators in large taverns, two in medium and 3 in small (because the drinker gambler/moves about more from tavern to tavern) .

Any other drawbacks? or should I get started?
 
As far as I'm concerned, I see no problem with just NOT having them at all.
There are plenty left from what I understand from you. No need to make work where there isn't a need for it, right? :shrug
 
You misunderstand, I think, Were in the other thread here. Here I'm referring to the ones used to place the player opposite the gambler/drinker in standard taverns. They are needed but this would reserve them for that purpose so you don't get double placement occurrences which is what all the convoluted code in case alc_2... in quest_common.c is about
 
AH! Sorry, have been doing a bit too much multi-tasking lately. :facepalm

Placing the player on candle locators to avoid NPCs using them? Fun idea! Definitely out-of-the-box thinking there. :onya
 
Just tried Oxbay and it will work fine. Cuts the code from
Code:
case "Oxbay_tavern":
                    if (characters[GetCharacterIndex(pchar.quest.friend_in_tavern)].location.locator == "sit1")
                    {
                    lx = -0.169727
                    ly = 0.008688494;
                    lz = 6.345457;
                    if((CheckLocationPosition(loadedLocation, lx,ly,lz))==true)
                        {
                        ChangeCharacterAddressGroup(pchar, "Oxbay_tavern", "sit", "sit11");
                        break;
                        }
                    GetCharacterPos(characters[GetCharacterIndex(pchar.quest.friend_in_tavern)], &x, &y, &z);
                    nearloc = LAi_FindNearestFreeLocator("sit", x, y, z);
                    if (nearloc=="sit9" ) ChangeCharacterAddressGroup(pchar, "Oxbay_tavern", "sit", "sit9");
                    }
                    if (characters[GetCharacterIndex(pchar.quest.friend_in_tavern)].location.locator == "sit3")
                        {
                        lx =-0.2043872;
                        ly = 0.02849323;
                        lz = 5.419554;
                        if((CheckLocationPosition(loadedLocation, lx,ly,lz))==true)
                            {
                            ChangeCharacterAddressGroup(pchar, "Oxbay_tavern", "sit", "sit2");
                            break;
                            }
                        GetCharacterPos(characters[GetCharacterIndex(pchar.quest.friend_in_tavern)], &x, &y, &z);
                        nearloc = LAi_FindNearestFreeLocator("sit", x, y, z);
                        if (nearloc=="sit13" )
                            {
                            ChangeCharacterAddressGroup(pchar, "Oxbay_tavern", "sit", "sit13");
                            break;
                            }
                                         
                            GetCharacterPos(GetMainCharacter(), &x, &y, &z);
                            nearloc = LAi_FindNearestFreeLocator("sit", x, y, z);
                            if (nearloc=="sit12" ) ChangeCharacterAddressGroup(pchar, "Oxbay_tavern", "sit", "sit12");
                        }
                   
                break;
Down to a more manageable
Code:
case "Oxbay_tavern":
                    if (characters[GetCharacterIndex(pchar.quest.friend_in_tavern)].location.locator == "sit1") ChangeCharacterAddressGroup(pchar, "Oxbay_tavern", "candles", "sit11");
                    if (characters[GetCharacterIndex(pchar.quest.friend_in_tavern)].location.locator == "sit3") ChangeCharacterAddressGroup(pchar, "Oxbay_tavern", "candles", "sit2");
                break;

Thanks fir the inspiration @Levis . I'll make the changes and post the resultant files
 
Unless I've missed something this should resolve the hard coded examples of sitting opposite, there are plenty of none hard coded taverns out there though so it's wait and see I suppose.
 

Attachments

  • candles.7z
    35.7 KB · Views: 69
I have added the zip fixes to Beta 4, and pedrwyth's fix does seem to fix an recruitable officer sitting at that top table, BUT not any of the other types of npcs that now also sit at that top table (sea crew wanting to join your ship, the insulted captian challanging you to a dual for his table etc).
Quoted this here and reopened the issue so we remember this doesn't seem 100% right just yet.
 
Looking at my latest installed version 18th January with 24th zip the large tavern locator file has not been included? So it's no wonder there is no solution! @Black Bart reference to "fixed" officer is likely only the pre-existing plascement upstairs with no reference to locators at all - thus all placements on sit10 will still be broken. Try post #14 of his original thread.

PS it was only posted 24th so no wonder it didn't make the zip of that date:)
 
Last edited:
Ah, then I might have it in my OWN game, but didn't post that yet. I might be able to rectify that tonight.... :wp
 
Back
Top