[Dev] SVN: james/501 Math Marauders: Now saves any changes you make to the map

James Paige Bob at HamsterRepublic.com
Fri Apr 11 11:31:57 PDT 2008


I was running into problems when saving a not-yet-existing asset.

Basically, I have a map asset which I create like so:

  map = AssetRef(BaseMap, "default")

So "data/default.map" does not exist anymore, but it correctly uses the 
_BrokenMap object when I play, so I have a map, but when I try to call 
map.asset_save() it crashes because map has no .asset_metadata property. 
(which makes sense, because this was not deserialized from disk)

So I have worked around the  problem by manually creating default.map in 
the editor, but is there some better way to say, "please save this 
asset to disk even though it was not loaded from disk"

You can reproduce the problem I was having by deleting data/default.map, 
running main.py, and clicking anywhere (which triggers the 
.asset_save() call)


---
James

On Fri, Apr 11, 2008 at 11:09:58AM -0700, subversion at HamsterRepublic.com wrote:
> james
> 2008-04-11 11:09:57 -0700 (Fri, 11 Apr 2008)
> 58
> Math Marauders: Now saves any changes you make to the map
> ---
> A   marauders/data/default.map
> U   marauders/locals.py
> U   marauders/main.py
> U   marauders/map.py
> 
> 



More information about the Dev mailing list