Hi
can anyone help? Python uses ‘True’ but the json library uses ‘true’. The same for ‘False’ and ‘false’
Using the starter bot, ‘‘isOccupiedByCyberTruck’’ is defined as boolean, and returns ‘true’ or ‘false’ which is always interpreted by Python as ‘False’. Is there a way to convert the ‘true’ to “True”, or could the data type of ‘isOccupiedByCyberTruck’ be changed to text or something else?
The python json library (which the starter bot uses) should convert the types correctly without any extra steps - are you using something else to parse the json state file?
I think that you might be confusing a cybertruck and a tweet object. The “T” on the map is the tweet powerup, which is the powerup that allows you to place cybertrucks (you can check if a block has a tweet on it by checking the surfaceObject of the block). Once a player places a cybertruck, the block’s isOccupiedByCyberTruck will turn true (and the block will show as a “C” on the map).
no. See the screen prints. You will see the output from the print instruction
print('truck ',self.game_state[‘worldMap’][1][6][‘isOccupiedByCyberTruck’] ) for each round