• 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!

Trophies in the Free Play mode

I've looked at the file and how it performs (in tests so far) and I am pretty impressed. Up to now the only (other) thing I don't like is the limited single raise, But seeing how you programmed that (MaxRaises) it is brilliantly easy to change, to say 3 levels (which I did). That would mean from 100,200,500,1000 or from 200,500,1000,2000 in both cases limited to 10 times the original buy in. I can see that as a good in-house tavern rule. Without the ability to bet strongly on a good hand you are just pushing 100/200 stakes around the table, a good way to pass time and study hands but not to actually win (and clean out your opponent). Of course I could just change that for our tournament because otherwise it IS a boring slog.

Yeah I just took some arbitrary values, so if someone has ideas on them I'm open for them. My idea was that unless there is indeed a folding option for the opponent (which I do like) there shouldn't be to much raising because else you could exploit the heck out of it :p .

btw @pedrwyth i hope that the changes I made to the file make it easier to read. Personally I think the way it is set up now makes it a lot easier to see what is happening and therefore easier to mod. But would love to hear your opinion on that.

Please don't. I'm already having trouble understanding all the new changes. When I don't understand code, I get suspicious. When I get suspicious, I'm liable to leave it out of the next update. However, to be fair, I'll test the version from post #94 when I get time and check that vingt-un/blackjack, at least, still works properly.

ok I will finish up the file (with all the right debug lines) and if no other bugs or anything are found will post a final version and not change it anymore for now :) .
 
Yeah I just took some arbitrary values, so if someone has ideas on them I'm open for them. My idea was that unless there is indeed a folding option for the opponent (which I do like) there shouldn't be to much raising because else you could exploit the heck out of it :p .
Well it's good to see a good hand and be able to push it, it's not the players fault the opponent doesn't employ the same tactics - so yes there is obviously an imbalance not so much the lack of a fold but more they don't push their good hands - until that happens then a bluff is not really a starter either. But small steps I think, as you know before you couldn't do anything but bet before the deal.

btw @pedrwyth i hope that the changes I made to the file make it easier to read. Personally I think the way it is set up now makes it a lot easier to see what is happening and therefore easier to mod. But would love to hear your opinion on that.
That's partly what I meant about impressed and obviously I quickly located how the raise was being controlled/limited jst from a couple of "finds" searches in notepad+. Of course I had found my way round the existing so had a head start but the ability via debug lines to get each step in compile makes it simple to backtrack what happened where. Personally I am in windowed mode so can tab out and see what is in compile when anything untoward (to my eye) happens (as in the case of those kings beating aces).

I have just tried a couple of hands of blackjack and with my change to MaxRaises got multiple raises there - so maybe that variable needs to be controlled per GameName.
 
I have just tried a couple of hands of blackjack and with my change to MaxRaises got multiple raises there - so maybe that variable needs to be controlled per GameName.

I believe I tried this before and it shouldn't impact it, but will take a look tonight. could be I missed that (I know i tested it, but I might have only tested it in the tavern where it was 1 so it didn't show any difference :p ).
 
I believe I tried this before and it shouldn't impact it, but will take a look tonight. could be I missed that (I know i tested it, but I might have only tested it in the tavern where it was 1 so it didn't show any difference :p ).
No you're right I think, what I was seeing was the raising of the bet for the NEXT hand not the one visible on the table
 
I didn't find a way to do multiple raises, but there is a far more serious problem. The lines in function "StartGame" which check for a natural 21 (ace plus 10 or face card) have been removed, so all checking for a 21 is done in "UpdateTable":
Code:
               if(sti(playerChar.cards.value)<=21)
               {
                   if(DEBUG_GAMBLING>1) trace("GAMBLING: Set Exit and Gold button to non-selectable");
                   SetSelectable("EXIT_BUTTON",false);
                   SetSelectable("ICON_GOLD",false);
               }

               if(sti(playerChar.cards.value)==21)
               {
                   if(DEBUG_GAMBLING_RULE>0) trace("GAMBLING: Blackjack score of player is exactly 21. [WIN]");
                   infoText = sti(playerChar.cards.value) + lucky_man;
                   bPlayerMove = false;
                   VewGamble(infoText);
                   UpdateBet("win");
                   return;
               }
The result is that if you score a 21, the "Exit" button is greyed out and you are forced to play another hand before you can exit the game.

Meanwhile, the poll on renaming Blackjack currently stands at 5 for Vingt-In, 4 for Twenty-One and 2 for Blackjack. Barring a sudden reversal, that means the game will be renamed to Vingt-Un, so here are my files for the rename including a fix for detecting a natural 21. Starting with the files from post #94, I've put back the lines in "StartGame" to check for a natural 21; added global variable "iNatural21" which is normally 0 and set by "StartGame" depending on whether the player, gambler or both scored a natural 21; and added some code to "UpdateTable" to check "iNatural21" and end the game appropriately. There are also some extra lines in "Habitue_dialog.h" to allow the gambler to react to a natural 21. I've tested it and it works, so at least the game allows you to quit if you score a natural 21.

In line with the change to Vingt-Un, I've changed all the switch cases, trace lines and even comments, from "Blackjack" to "Vingt-Un". (Except one, which was changed to "Poker". ;))
 

Attachments

  • VingtUn.zip
    201 KB · Views: 129
@Grey Roger noticed that your version had a problem with the help text for vingt-un always appearing because of a wrong replace :) .
so fixed that, and also fixed the bug you found more elegantly (if I say so myself).

Here is a new WIP version of the gamble.c file. You do need the other changed files from the post above here.
Tomorrow or on monday I will upload a zip including everything together (with the casino too).
 

Attachments

  • gamble.c
    102.7 KB · Views: 130
If it's a matter of programming aesthetics, I prefer my own style - if I didn't, I wouldn't use it. In particular, I prefer switches to a succession of ifs. :p

But you're right about the help text continuing to appear. The problem was that when I tried to change this line:
Code:
case "Vingt-Un": if(bFirstTime) playerChar.firsttime.VingtUn = true; break;
to use 'playerChar.firsttime.Vingt-Un', "gamble.c" crashed. I didn't think to try putting quotes round "Vingt-Un". But of course, "VingtUn" doesn't work because the check is 'CheckAttribute(playerChar,"firsttime."+GameName)', which means the attribute must exactly match the game name. So I got rid of the switch which sets the attribute entirely, and now this is how the "firsttime" attribute is set:
Code:
   string FirstTimeAttr = "firsttime." + GameName;
   playerChar.(FirstTimeAttr) = true;

Next thought - how about using vingt-un rather than poker when gambling with a soldier for a smuggling patrol schedule? Dice is implied, if not actively used, for the gambled girl quest. Poker is to be used for the forthcoming gambler quest. That leaves vingt-un as the only game without any quest use.
 

Attachments

  • gamble.c
    100.2 KB · Views: 119
There's another minor problem associated with gambling - nothing to do with "gamble.c", "habitue_dialog.c", or any specific game. There are no drunks/gamblers in either Santiago or Havana taverns, which means if you start a FreePlay as a gambler, the nearest place to do any gambling is Port au Prince. The tavern there is a clone of the one in Sao Jorge and does have a drunk/gambler, but not in the same seat. If quest case "alc_2_prepare" can't identify the tavern, it puts the player in the nearest "sit" locator to the gambler, which in Port au Prince tavern at least is the one beside him, not the one opposite him.

@pedrwyth, @Jack Rackham: does your gambler quest involve any of Santiago, Havana or Port au Prince taverns? If not, I'm going to add a character to each of Santiago and Havana, and also set up locator files with a "sit" locator changed to a "candles" locator in each one so that when you sit opposite the gambler, you won't be sitting on someone else's knee. (This has already been done to all the taverns named in quest case "alc_2_prepare". I'll also add some code there to recognise Santiago, Havana and Port au Prince taverns.)
 
@Jack Rackham: thanks for that. I thought I'd better check before doing anything that might either mess up the quest or need to be undone for the quest to work.

@Levis: your new code for disabling and re-enabling the "Exit" button works fine - thanks! :onya

I've made a new locator file for Port au Prince tavern which is a version of the original "ST_l.gm" with "sit3" put back into group "sit" and "sit4" put into group "candles". (We may need to change all those "candles" seat locators to something else. Group "candles" is, of course, for candles, and the lighting system puts glows on them. If you look closely, you can sometimes see a glow under the seat in question.)
 
(We may need to change all those "candles" seat locators to something else. Group "candles" is, of course, for candles, and the lighting system puts glows on them. If you look closely, you can sometimes see a glow under the seat in question.)
Ah well six years ago I would never have dared to add a new locator group but by all means go for it.:)
 
It works, sort of. I changed locators in each of Port au Prince, Havana and Santiago taverns to group "sit2". The candle glow no longer appears under the seat in Port au Prince, nor is there any glow under the seats in Havana and Santiago taverns. With entries in case "alc_2_prepare" in "quests_common.c" for each of the taverns, you sit at the correct locator opposite the gambler. And as "sit2" is not a standard group, there should be no weirdness such as other characters trying to spawn there, phantom lights, etc.

There is one side-effect, though. Because "sit2" is not a recognised group, the locator doesn't show up when "VISIBLE_LOCATORS" is set to 1. So, for now at least, I'm not going to bother changing all seat locators from "candles" to "sit2". Nobody has reported the light under their backsides since the seat locators were changed to "candles" in the first place, and unless someone else does, they may as well stay as they are. But Havana and Santiago taverns certainly need the different locator group because at night their lighting shows candlelight much more than most places - the candles would, after all, be the only source of light after sunset!

Do we want a drinker/gambler in Cartagena tavern as well? Gamblers might prefer the casino, or they might prefer normal betting rules (and an inexperienced opponent) in the tavern.
 
What's the current overview of which background profession have their unique trophy already, which don't and which are in progress?
 
Update: having checked Sao Jorge tavern to see if it shows the same phantom light under the seat, I've modified the standard "ST_l.gm" locator file to use "sit2" instead of "candles". This is also used by the taverns in a few other places, so I changed their entries in case "alc_2_prepare" to put you onto a "sit2" locator instead of a "candles" locator when gambling. One of the taverns is the one in St. Pierre, where there is no gambler and the "candles" locators are occupied by Andre Juliao and Thierry Bosquet, so I changed them as well, then ran a quick FreePlay to check that they show up.

@Jack Rackham: the search for other places using "ST_l.gm" also found "Fort_Moultrie_barracks" in the "GoldBug" story. And that's when I found that "Moultrie_offduty4" does not appear because his definition places him on group "sit", locator "sit3", which is one of the locators which was changed to "candles" for the benefit of gamblers. If you want him to show up, change his locator group to "candles", and I'll change it to "sit2" in the next update which will include the revised "ST_l.gm".
 
What's the current overview of which background profession have their unique trophy already, which don't and which are in progress?
Engineer and Gambler have work done, as far as I understand.
Don't remember hearing about any of the others.
 
Back
Top