<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[memory problem,plz help me!]]></title><description><![CDATA[<p>it seems the memory errors,spawns and rooms just disappear in the memory list.
<img src="/forum/assets/uploads/files/1697849833338-ee33d555-3f30-4561-8ff1-5d4a25f79ae3.png" alt="0_1697849833161_EE33D555-3F30-4561-8FF1-5D4A25F79AE3.png" class="img-responsive img-markdown" />
I tried to insert  <em>RawMemory.set('{}')</em> into console,but is seems does't work.
can't find the creep,spawn,even the room,same codes shows diffierent results,plz help me!!<img src="/forum/assets/uploads/files/1697850849390-c4df40fd-311c-41d8-a577-168441d68d69.png" alt="0_1697850849210_C4DF40FD-311C-41d8-A577-168441D68D69.png" class="img-responsive img-markdown" /></p>
]]></description><link>http://screeps.com/forum/topic/3280/memory-problem-plz-help-me</link><generator>RSS for Node</generator><lastBuildDate>Thu, 08 Oct 2026 22:47:53 GMT</lastBuildDate><atom:link href="http://screeps.com/forum/topic/3280.rss" rel="self" type="application/rss+xml"/><pubDate>Sat, 21 Oct 2023 01:14:17 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to memory problem,plz help me! on Invalid Date]]></title><description><![CDATA[<p>it seems the memory errors,spawns and rooms just disappear in the memory list.
<img src="/forum/assets/uploads/files/1697849833338-ee33d555-3f30-4561-8ff1-5d4a25f79ae3.png" alt="0_1697849833161_EE33D555-3F30-4561-8FF1-5D4A25F79AE3.png" class="img-responsive img-markdown" />
I tried to insert  <em>RawMemory.set('{}')</em> into console,but is seems does't work.
can't find the creep,spawn,even the room,same codes shows diffierent results,plz help me!!<img src="/forum/assets/uploads/files/1697850849390-c4df40fd-311c-41d8-a577-168441d68d69.png" alt="0_1697850849210_C4DF40FD-311C-41d8-A577-168441D68D69.png" class="img-responsive img-markdown" /></p>
]]></description><link>http://screeps.com/forum/post/16727</link><guid isPermaLink="true">http://screeps.com/forum/post/16727</guid><dc:creator><![CDATA[chencreep]]></dc:creator><pubDate>Invalid Date</pubDate></item><item><title><![CDATA[Reply to memory problem,plz help me! on Invalid Date]]></title><description><![CDATA[<p><a class="plugin-mentions-user plugin-mentions-a" href="http://screeps.com/forum/uid/7016">@chencreep</a> incorret memory path,or can I  just reset the memory?</p>
]]></description><link>http://screeps.com/forum/post/16728</link><guid isPermaLink="true">http://screeps.com/forum/post/16728</guid><dc:creator><![CDATA[chencreep]]></dc:creator><pubDate>Invalid Date</pubDate></item><item><title><![CDATA[Reply to memory problem,plz help me! on Invalid Date]]></title><description><![CDATA[<p>I don't exactly understand your intention and what you are trying to achieve but here are some hints:</p>
<p>You need to differentiate between the memory stored in the DB and your instance.<br />
What you see in the UI is whats stored in the DB, and only the snapshot when you loaded it into the UI.<br />
This should be at best viewed as a reference since it gets out of sync easily.<br />
Manipulating stuff in the UI is a good way to loose data.</p>
<p>If you type <code>RawMemory.set({})</code> you essentially wipe the DB memory every tick.</p>
<p><code>RawMemory.set(function-&gt;string)</code> governs how you safe stuff in the DB,<br />
it gets called every tick automatically after your main loop is done.</p>
<p>On the flip side the <code>Memory</code> Object boils down to <code>Memory = JSON.parse(RawMemory.get())</code><br />
when you access it for the first time in a tick.</p>
<p><a href="https://docs.screeps.com/global-objects.html#Memory-object" rel="nofollow">https://docs.screeps.com/global-objects.html#Memory-object</a></p>
<p>So yeah you are wiping the DB which in turn wipes the Memory in your instance, hence chaos.</p>
<p>But fear not, simply leave <code>RawMemory</code> alone in your code, refresh your code and everything should be recreated.<br />
Only fields that are set can be mirrored and refreshing your code is a good way to force that.</p>
]]></description><link>http://screeps.com/forum/post/16729</link><guid isPermaLink="true">http://screeps.com/forum/post/16729</guid><dc:creator><![CDATA[MrFaul]]></dc:creator><pubDate>Invalid Date</pubDate></item><item><title><![CDATA[Reply to memory problem,plz help me! on Thu, 09 Nov 2023 17:22:31 GMT]]></title><description><![CDATA[<p><a class="plugin-mentions-user plugin-mentions-a" href="http://screeps.com/forum/uid/7016">@chencreep</a> you can recreate the missing properties with <code>Memory.creeps={}</code> and <code>Memory.rooms={}</code> and <code>Memory.spawns={}</code>
In your main.js you can write <code>if (!_.isPlainObject(Memory.rooms)) Memory.rooms = {};</code> for rooms, creeps, spawns to automatically fix issues like this.</p>
]]></description><link>http://screeps.com/forum/post/16731</link><guid isPermaLink="true">http://screeps.com/forum/post/16731</guid><dc:creator><![CDATA[Xenofix]]></dc:creator><pubDate>Thu, 09 Nov 2023 17:22:31 GMT</pubDate></item></channel></rss>