The error is bad there - but I think the correct solution is to create a new map in the editor that is connected to a file, and then edit it. The broken asset is really intended to be a "hey! you have a bad asset reference" object and to be a bootstrapping device (i.e. you can run it long enough to create an asset)<br>
<br>basically it might be nice to have a "save as" mechanic, but I don't see how any such mechanic would be any less work than creating a new asset in the editor?<br><br><div class="gmail_quote">On Fri, Apr 11, 2008 at 11:31 AM, James Paige <<a href="mailto:Bob@hamsterrepublic.com">Bob@hamsterrepublic.com</a>> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">I was running into problems when saving a not-yet-existing asset.<br>
<br>
Basically, I have a map asset which I create like so:<br>
<br>
map = AssetRef(BaseMap, "default")<br>
<br>
So "data/default.map" does not exist anymore, but it correctly uses the<br>
_BrokenMap object when I play, so I have a map, but when I try to call<br>
map.asset_save() it crashes because map has no .asset_metadata property.<br>
(which makes sense, because this was not deserialized from disk)<br>
<br>
So I have worked around the problem by manually creating default.map in<br>
the editor, but is there some better way to say, "please save this<br>
asset to disk even though it was not loaded from disk"<br>
<br>
You can reproduce the problem I was having by deleting data/default.map,<br>
running main.py, and clicking anywhere (which triggers the<br>
.asset_save() call)<br>
<br>
<br>
---<br>
James<br>
<div><div></div><div class="Wj3C7c"><br>
On Fri, Apr 11, 2008 at 11:09:58AM -0700, subversion@HamsterRepublic.com wrote:<br>
> james<br>
> 2008-04-11 11:09:57 -0700 (Fri, 11 Apr 2008)<br>
> 58<br>
> Math Marauders: Now saves any changes you make to the map<br>
> ---<br>
> A marauders/data/default.map<br>
> U marauders/locals.py<br>
> U marauders/main.py<br>
> U marauders/map.py<br>
><br>
><br>
</div></div>_______________________________________________<br>
Dev mailing list<br>
<a href="mailto:Dev@lists.motherhamster.org">Dev@lists.motherhamster.org</a><br>
<a href="http://lists.motherhamster.org/listinfo.cgi/dev-motherhamster.org" target="_blank">http://lists.motherhamster.org/listinfo.cgi/dev-motherhamster.org</a><br>
</blockquote></div><br>