• 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 Drinking and Gambling at the Tavern

I too originally understood that brackets were required but I thought I had seen either a reference or actual usage of the other structure somewhere in POTC mod information/code but of course I can't find it now.

I had lots of trace statements and putting players in sit locators via console whilst working on it, I might still have that version lying around somewhere . Since I created the situation (and am currently doing nothing else anyway) I am happy to work through the variations and will report back on actual behaviour for the record.

In the meantime, to be safe, I will add brackets where there is more than one action after the if condition and post the file
 
In the meantime, to be safe, I will add brackets where there is more than one action after the if condition and post the file
If you can do that, it should be quite enough. I'd do it myself, but don't want to risk actually messing up what it is supposed to do..
You already know the code behaves the way you would expect it to, so that is a relief. :cheeky
 
Actually the code you posted was the original, in my later 17th august version (above) the code is already nicely set in brackets :yes- so maybe it was a problem - probably since I changed it- I don't remember my focus was on adding a further check related to player positioning. However that later code is apparently not yet in the game.:(
 
Actually the code you posted was the original, in my later 17th august version (above) the code is already nicely set in brackets :yes- so maybe it was a problem - probably since I changed it- I don't remember my focus was on adding a further check related to player positioning. However that later code is apparently not yet in the game.:(
Sooo.... what code is in the game right now? I can't check right now....
 
Looks like the earlier 13th August with typo corrections. (based on fresh install of 7th sept exe using beta 4 file over stock game)
 
Looks like the earlier 13th August with typo corrections. (based on fresh install of 7th sept exe using beta 4 file over stock game)
So the current Beta 4 WIP already contains your typo correction and the brackets around the if-statements?
If so, we can mark this one "Fixed". :doff
 
No you misunderstand me - I had posted a version with brackets etc (and a further check related to main character position) on 17th august - this is NOT in the game. The game version has no brackets on the double statement after IF so seems based on the 13th August version, the typo corrections were yours I think. So it still needs the later version adding in.

The current version as is would have fixed the lock up at/near the table bug so that can probably be called fixed since no-one has since reported a problem. It will not reliably put the player at an improved sitting location.
 
Indeed I decidedly did NOT have your most recent version in my game!
Corrected now. Thanks again for your hard work. "Fixed" now as far as I'm concerned. :doff
 
I ran into this guy in the Havana Tavern:

upload_2015-9-27_18-57-25.png


He's not sitting on ANY locator? How that that work? :shock
 
I just meet him again!
 

Attachments

  • seadogs2_00134.jpg
    seadogs2_00134.jpg
    265.4 KB · Views: 176
Could it be this is for certain models? Might they have the locators in them set wrong or something like that?
 
@ANSEL: Was that the Havana Tavern again?

@Levis: If you see my screenshot above, you can there isn't actually a locator in that spot.
Maybe a typo with coordinates? If I recall, @pedrwyth coded some numbers into quests_common.c
 
The ones I dealt with (or partially dealt with perhaps - still awaiting confirmation which taverns A.H had problems with and not had time to look myself) were stock game locations with hardcoding (ie small,medium and large tavern models) - Havana seems to use a different model (Tavern_2) and isn't one of the original game locations. In any case I didn't affect NPChars (except by fractionally moving a couple of sit locators in small and large taverns- but they were still on benches).

How the "sit in mid air" occurs for PChar in those hard coded stock game cases is where the game can't find a suitable sit locator you are by default left where you initiated conversation BUT now with a sit model - hence you are sitting in thin air (but the scene shifts to close up interaction so it isn't too glaring - and better than sitting across the tavern!!) and not on a locator. Can't immediately think how a similar situation can arise unless the model in the examples is being placed by co-ordinates rather than by locators (since aa @Pieter Boelen points out there seems to be no locator indicated at that location in his example)


My co-ordinates come from locator coordinates in the small,medium and large taverns model files for the preferred sit positions to check they are vacant - can't see how this could affect another tavern model - even if it used the same locator file (which I can't imagine ever happening)?

I might as well look at the tavern models I ignored before since it could turn out the other reports are related to behaviour with them too.

Anyone know where the code is for placing NPChars in taverns? - I might as well see if @Levis idea of avoiding placing them at particular points could have some merit. I wouldn't block the locators though in case they are used for quest characters somewhere
 
Anyone know where the code is for placing NPChars in taverns? - I might as well see if @Levis idea of avoiding placing them at particular points could have some merit.
I'm not at all sure and cannot check right now. Check a tavern location init entry and see what is its location type (probably "tavern").
Then search the PROGRAM folder for "type tavern" and see what you get.

I suspect it will be in PROGRAM\LandEncounters or PROGRAM\Loc_ai\LAi_monsters.c or so.
Another option is to search the program folder for "Habitue_dialog.c" which will hopefully provide a clue too.

I wouldn't block the locators though in case they are used for quest characters somewhere
If a lock for random characters can be made, probably that can be bypassed for quest purposes.
I imagine?
 
Ok can (randomly) reproduce this in Havana and Cartagena (both type tavern_2). Trying to dump the character attributes of the guilty parties crashes the game at console call with missing character ID in compile log (they are referenced as receiving a weapon in compile and if the right "sort" I can hire them as an officer OK). Whilst trying to get this to occur did see people (and soldiers) using all the locators on the table to the right.

There actually seem to be two phantom sit positions I can trigger behind the two seen at the bench to the right - think i'll check the tavern locator model file next just to be certain what the model has inbuilt - although I doubt there is anything that visible locators wouldn't be showing.
 
Ok can (randomly) reproduce this in Havana and Cartagena (both type tavern_2). Trying to dump the character attributes of the guilty parties crashes the game at console call with missing character ID in compile log (they are referenced as receiving a weapon in compile and if the right "sort" I can hire them as an officer OK). Whilst trying to get this to occur did see people (and soldiers) using all the locators on the table to the right.
Are you typing in the character names that you see in compile.log?
Their IDs are probably different, so that wouldn't work. :facepalm

What you could put a DumpAttributes(NPChar); line in their dialog or in the "O" interface file (PROGRAM\INTERFACES\Officer.c, I think).
 
Are you typing in the character names that you see in compile.log?
Their IDs are probably different, so that wouldn't work.

Yes I was being that simplistic (and wrong).

Via dialogue dumps I find the ID's are actually generally "Location fantom character <0>"
Dumping attributes shows in this one case the code thinks he is sitting at sit10 - which is sort of directly below downstairs! I presume the other nearer the door that are shown in the thread above are sit9 instances - so probably just some sort of hiccup in the vertical co-ordinate. Somehow the label locators show downstairs but the character is placed upstairs. More anon
 
Back
Top