Page 1 of 2

Taverns - implementation

Posted: Sat Feb 03, 2018 9:56 pm
by Hazelnut
I'm most of the way though basic implementation of taverns.

Classic DF limits the number of days you can rent a room to 350, anyone have any idea why that limit is there. Like, are there issues with renting a tavern room for more than a year (360 days) that I don't know about?
At the moment I have it simply cap at 999 days. (i.e. you can enter 3 digits)

Also leaning towards leaving dressers etc as private property.

Re: Taverns - implementation

Posted: Sat Feb 03, 2018 10:55 pm
by Interkarma
It's probably just an arbitrary limit but 350 days feels a bit more "in world" like something an innkeeper might say, whereas 999 feels like something a computer programmer would say. I honestly don't mind either way, though. Go with what you feel is best. :)

Agree the dressers should stay private property. it doesn't make sense for player to store items in them permanently, and I'd rather they get the "private property" warning so they don't store items in these containers and lose them by accident.

Re: Taverns - implementation

Posted: Sun Feb 04, 2018 8:58 am
by Hazelnut
I agree - will implement the limit and leave furniture in taverns private.

Need to allocate random rest marker next.

Re: Taverns - implementation

Posted: Sun Feb 04, 2018 9:12 am
by Feralwarlord
hmmm perhaps you could set the limit to 1 in game year and if someone tries to rent a room for longer than have have the inn keeper spout some line about a local law or a inn policy or something as a reason why you can rent a room for more than a year at a time

Re: Taverns - implementation

Posted: Sun Feb 04, 2018 12:41 pm
by R.D.
Yeah I agree with Interkarma it's probably just arbitrary but sounds more "real world" than a 999 day limit so I would go with it.

Great work, by the way! I'll try to help with anything I can.

Re: Taverns - implementation

Posted: Sun Feb 04, 2018 9:31 pm
by Hazelnut
Thanks, just finished up the tavern room renting system. Works great, I'm really happy with it. You can leave anything you like there while you have a rented room and they will actually stay even after rental expires, as long as you don't leave town, for you to pick them up. If you leave town then the tavern keeper sells it all and throws a party! :D

Going to tidy code up and submit PR.

Allofich: I've left a FormulaHelper.CalculateRoomCost() method for you to work your binary wizardy magic on!

I'll do the food and drink menu option soon.

One thing I noticed when I was doing the bed allocation and move to code was there are 'random flat' markers that don't appear to be converted to any normally rendered flat. What are these for, or are they not yet implemented?

Re: Taverns - implementation

Posted: Mon Feb 05, 2018 8:39 pm
by Hazelnut
Took a look at the issue with Daggerfall/The Rusty Ogre Lodge tavern called The White Goblin, and the PlayerGPS.IsPlayerInTown() method is returning false so you can rest without renting a room, and since you don't need to it doesn't put you in bed.

Only other place it's used is GivePc line 82, so I think that function will have the same issue. Or is it intended not to work in lodge type of towns?

Yep adding CurrentLocationType == DFRegion.LocationTypes.Tavern to the conditional works. Is that okay or does givePc have different needs to the resting system?

Re: Taverns - implementation

Posted: Mon Feb 05, 2018 9:09 pm
by Interkarma
Thank you for the info. There's an alignment issue with some single-block locations. I thought I had resolved all of those. I'll take a look at this when I can.

GivePc trigger has different needs. The main thing is you can work around the problem for now in room rentals.

Re: Taverns - implementation

Posted: Mon Feb 05, 2018 9:24 pm
by Hazelnut
Interkarma wrote:Thank you for the info. There's an alignment issue with some single-block locations. I thought I had resolved all of those. I'll take a look at this when I can.

GivePc trigger has different needs. The main thing is you can work around the problem for now in room rentals.
Not sure what alignment issue with single block locations means - could you explain?

GivePc shouldn't work in tavern/lodge locations then? Why is that? The class just says :

"require player to be within a town, outdoors, and during set hours for action to fire"

Re: Taverns - implementation

Posted: Mon Feb 05, 2018 10:02 pm
by Interkarma
I've just misunderstood what you were saying, sorry.

Historically IsPlayerInTown() would fail due a problem where town was physically offset in the world and location rect was not where it needed to be. This one gave me a fair bit of grief, so my mind went straight to that when you mentioned town check was failing again. Now I understand you're just saying the location type isn't included in the check.

Yep, that's an easy fix and happy for the tavern location type to be added to the conditional. :)