There was a discussion about weapon systems a while back: Creating a weapon system
Slightly related: Calling a function with a string - #2 by britzl
Yes, you need to define the bounds of your tilemap even when you’re generating the actual contents at runtime. It’s enough to set one tile in each corner of the tilemap and the use tilemap.get_bounds() and tilemap.set_tile()