Help with variables in a table

Hi,

I'm trying to set a table up that lets me calculate a bounty but it doesn't seem to work as expected.

This line is meant to give me the value:

Bounty: ${$Bounty+$Bountymod*250}

An example crime is:

Arson {Bounty==1d6}

but it doesn't seem to work. It tends to generate something like Crimes Arson Bounty: $6

The Bountymod is set to 0 in the opening part of the table and the crime

Repeat Offender {Bountymod==+3}

Any ideas as to where I'm going wrong?

Comments

  • If I could see the whole text, then I could give suggestions. That's why I usually give an entire copy of what I am working on so people can see what exactly I might be doing wrong. Without knowing how your Gen works we could actually make it worse by giving suggestions.

  • Here's the relevant bits:

    Set:Bountymod=0
    Table:D10_BOUNTY
    Crimes [!D10_BOUNTY_Crimes] Bounty: ${$Bounty+$Bountymod*250}

    Table:D10_BOUNTY_Crimes
    Arson {Bounty==1d6}
    Repeat Offender [!D10_BOUNTY_Crimes] {Bountymod==+3}

    I hope this helps?

  • I get results like this:

    Crimes Repeat Offender Arson Bounty: $752

    Crimes Arson Bounty: $3

    Crimes Repeat Offender Arson Bounty: $752

    Crimes Arson Bounty: $3

    Crimes Repeat Offender Arson Bounty: $755

    Crimes Repeat Offender Arson Bounty: $755

    Crimes Arson Bounty: $1

    Crimes Arson Bounty: $1

    But that's what I expect. What do you want to be different from that?

  • I was expecting the minimum bounty for Arson to be $250 . Do I need to put the *250 outside of the brackets?

  • edited January 2022

    You can probably just use regular parentesis, but, yes... get the x250 outside the bounty + bountymod calculation. Right now it's taking bountymod*250 plus bounty. So if bountymod is 0 or undefined, then it's 0 + bounty.

    Bounty: ${($Bounty+$Bountymod)*250}

    will probably work. You will get multiples of 250. Like, if bounty (1d6) roll 5, and bountymod = 0, you will get 1,250. If bountymod =3 and 1d6 rolls a 5 you will get 2,000. Is that more what you are expecting?

  • Many thanks Levendor, that's the result I was looking for.

Leave a Comment