The IsCargo property seems persistent even after unloading

Per the reference manual the IsCargo property should be “true” when the cargo piece is loaded on a mat and “” when it is not. However, In my module the IsCargo property seems to stay “true” even after being unloaded from the mat to a different spot on the same map as the mat. IsCargo stays “true” when moving the piece from one non-mat location on the map to another non-mat location on the same map. IsCargo stays “true” even when moving the piece from one non-mat location on the map to another non-mat location on a different map that doesn’t have any mats.

Here’s a link to my module in development:

To replicate the problem:

  1. Start a new game.
  2. Click the PlayerA button on the toolbar to show the PlayerA map window.
  3. Click the Rounhouse button on the toolbar to show the Roundhouse map window.
  4. Click on the CompanyStock tab to show the company stock certificates (only St Louis Southwestern Railway certificates available so far).
  5. The president’s certificate should be on top, it has three logos on the left; drag it to the PlayerA map window.
  6. You should be prompted for an initial stock price; enter any number (typical values are between 60 and 150).
  7. On the Roundhouse map, click the Turntable tab; there should be the St Louis Southwestern Railway charter (this is a mat) with 7 St Louis Southwestern Railway single share, stock certificates (these have only one logo on the left) on the mat.
  8. Drag the mat to the PlayerA map window.
  9. Select one single St Louis Southwestern Railway stock certificate and drag it off the mat on to a non-mat area of the PlayerA map window; I’m thinking the IsCargo property of this certificate should be “” because it is no longer on the mat. I have a debug report in the Chat log reporting properties relating to the certificate being moved which indicates that the IsCargo property is staying “true” when it should have changed to “”.
  10. You drag this certificate to another location on this map window.
  11. You can show the Bank map window by clicking on the Bank button on the main map toolbar. You can drag the single certificate to the Bank map window. When I did my debug report was still showing the certificate had an IsCargo property of “true”.

Note: I may have some logic errors causing miscalculation of shares for PlayerA and the St Louis Southwestern Railway, or these miscalculations may be resulting from erroneous values for IsCargo.

Could you point out where it says this please? This contradicts with the Cargo trait doco which says

IsCargo will always contain the string “true” for a Mat Cargo piece (it will contain an empty string, “” for a piece which does not have this trait).

1 Like

If you want to check if a piece is currently loaded on to a Mat, I believe you should be checking if CurrentMat == “” or not.

(Corrected, Thanks Benkyo)

1 Like

(Obvious typo, but CurrentMat)


Sorry. I misread the manual. It does say IsCargo is “true” for pieces with the MatCargo trait. It doesn’t say anything about whether or not the pieces are loaded on a mat.

Thanks for patiently pointing that out and suggesting a property which I should check.

1 Like