Gambling dealers, check?

FDO

Still Mildly Glowing
Hi,

Trying to understand something in the games dealer scripts. Is this:

Code:
   // display results
   item_caps_adjust(dude_obj, the_result*bet_amt);
   dice_reply(400 + (dude_has_important_rep*(dude_is_male + (2*dude_is_female))) + (10*the_result));
   play_dice_options
   dice_option(440 + night, Node999, 001);

Supposed to mean that the text spoken by the dealer will vary from 400 to 440 possible strings in the msg, depending on the result of the roll and other parameters? That's the only logic I can work out from studying the gambling scripts as to why many strings, the winner lines included aren't clearly called by the script?

I understand most of the rest, or I will soon, but can you also tell me why the script is apparently multiplying the dude_is_female macro?
 
For choosing between "sir" or "ma'am" lines in msg, because if dude_is_female is true (1) , obviously dude_is_male will be false (0).
 
Yes, I thought so, so the logic in that code is that by multiplying the macro, it tell the script that the character is female? This is a multiplying sign right, not something else?

Anyways, after quick testing on a new script, it appear that this kind of code does select a array of answers according to the roll results... First time I see such a ergonomic code in F2 scripts, or that I take the time to try to figure it maybe. I guess more testing is in order to sort out the details.
 
I got it. In case someone who doesn't is stumbling upon this thread someday:
Let's take this code,
Code:
         gSay_Reply(SCRIPT_RDEALER, mstr(400 + (dude_has_important_rep*(dude_is_male + (2*dude_is_female))) + (10*the_result)) + mstr(5000 + day));
   end
   else begin
      dice_reply(400 + (dude_has_important_rep*(dude_is_male + (2*dude_is_female))) + (10*the_result));
      play_dice_options    
   end
   dice_option(440 + night, Node999, 001);

Associated with these lines:
Code:
{400}{}{Sorry, better luck next time.}
{401}{}{Sorry, sir. Better luck next time.}
{402}{}{Sorry, ma'am. Better luck next time.}
{403}{}{Sorry, lady. Better luck next time.}

{410}{}{Match.}
{411}{}{Match. Try again sir?}
{412}{}{Match. Try again ma'am?}
{413}{}{Match. Try again lady?}

{420}{}{Winner! You've doubled your money!}
{421}{}{Winner! You've doubled your money! Well done, sir!}
{422}{}{Winner! You've doubled your money! Well done, ma'am!}
{423}{}{Winner! You've doubled your money! Well done, lady!}

{430}{}{Winner! You've tripled your money!}
{431}{}{Winner! You've tripled your money! Luck is in the house tonight! Well done, sir!}
{432}{}{Winner! You've tripled your money! Luck is in the house tonight! Well done, ma'am!}
{433}{}{Winner! You've tripled your money! Luck is in the house tonight! Well done, lady!}

{440}{}{Call it a day.}

The 2 in 2*dude_is_female actually mean that the script is choosing the lines ending by the digit 2 within the array, the ma'am lines.
If you replace it by 3*dude_is_female, then the script will choose the lady lines. You should get the logic.
For the record, since dude_is_male is the first macro checked, providing the dude has a important rep registered by the corresponding macro of course but I am not gonna teach you script bases, the dude_is_male doesn't need a 'x*' . It is 1* by default. You could wrote it and have the same result, the sir lines, but it's not necessary.

This leaves the 10* in 10*the_result, which is a little more opaque, but I think I get the essential. Here it doesn't tell the script to choose lines ending by 10, but to choose from every lines ending by a tenth number within the array, can be 402, 421, ect until 433, depending on the roll results and the other parameters. It's what I draw from several tests.
 
Back
Top