As soon as I pressed send, I realized maybe the issue here is that you don't want the broken reference model at all - you want a completely different model, that is a nearly identical mechanism... I guess what you want is to say, I want an asset instance that uses assetID "blah" that exists even if I don't have one on disk yet?<br>
<br>so it solves bootstrapping, but at the same time lets you edit that bootstrapped item if you want?<br><br>I imagine it would be something like:<br>MapPouch.AddBootstrapObjectForAssetID("default", value)<br>where maybe value is optional?<br>
<br>... if that sounds good, what do you think of that name for it? basically I want the name to be as clear as possible about what it does - it's setting what value you should get for an asset of a particular id if it doesn't exist on disk yet...<br>
<br><div class="gmail_quote">On Fri, Apr 11, 2008 at 11:56 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;">
<div class="Ih2E3d">On Fri, Apr 11, 2008 at 11:50:15AM -0700, Brian Fisher wrote:<br>
>    The error is bad there - but I think the correct solution is to create a<br>
>    new map in the editor that is connected to a file, and then edit it. The<br>
>    broken asset is really intended to be a "hey! you have a bad asset<br>
>    reference" object and to be a bootstrapping device (i.e. you can run it<br>
>    long enough to create an asset)<br>
><br>
>    basically it might be nice to have a "save as" mechanic, but I don't see<br>
>    how any such mechanic would be any less work than creating a new asset in<br>
>    the editor?<br>
<br>
</div>It would be needed for something edited directly in the game window.<br>
<div><div></div><div class="Wj3C7c"><br>
---<br>
James<br>
<br>
>    On Fri, Apr 11, 2008 at 11:31 AM, James Paige <<a href="mailto:Bob@hamsterrepublic.com">Bob@hamsterrepublic.com</a>><br>
>    wrote:<br>
><br>
>      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>
>      James<br>
>      On Fri, Apr 11, 2008 at 11:09:58AM -0700, subversion@HamsterRepublic.com<br>
>      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>
>      _______________________________________________<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>
<br>
> _______________________________________________<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>
<br>
_______________________________________________<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>
</div></div></blockquote></div><br>