{"action":"opened","issue":{"url":"https://api.github.com/repos/d2718/dta4/issues/1","labels_url":"https://api.github.com/repos/d2718/dta4/issues/1/labels{/name}","comments_url":"https://api.github.com/repos/d2718/dta4/issues/1/comments","events_url":"https://api.github.com/repos/d2718/dta4/issues/1/events","html_url":"https://github.com/d2718/dta4/issues/1","id":126948813,"number":1,"title":"Saving the State or the Game","user":{"login":"d2718","id":16721230,"avatar_url":"https://avatars.githubusercontent.com/u/16721230?v=3","gravatar_id":"","url":"https://api.github.com/users/d2718","html_url":"https://github.com/d2718","followers_url":"https://api.github.com/users/d2718/followers","following_url":"https://api.github.com/users/d2718/following{/other_user}","gists_url":"https://api.github.com/users/d2718/gists{/gist_id}","starred_url":"https://api.github.com/users/d2718/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/d2718/subscriptions","organizations_url":"https://api.github.com/users/d2718/orgs","repos_url":"https://api.github.com/users/d2718/repos","events_url":"https://api.github.com/users/d2718/events{/privacy}","received_events_url":"https://api.github.com/users/d2718/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2016-01-15T20:11:50Z","updated_at":"2016-01-15T20:11:50Z","closed_at":null,"body":"This needs to be implemented.\r\n\r\n### Naive Idea\r\nEach `ROOM` and `THING` (and each subclass thereof) has its own code generation method to call the appropriate `(MAKE-whatever ... )` function and save them all in a file in the world directory to be loaded just like the default `world.lisp` file is loaded. This would also require at least a second pass to add everything to the appropriate `LOCATION`s (and also to set the `DATA` field for things that need it---this may or may not require additional passes).\r\n\r\n### A problem:\r\nHow do we deal with the scripts attached to `THING`s? They end up getting compiled on load, and I'm not sure they can get written to a source file in a way that can be reread by the Lisp interpreter.\r\n\r\n### Solution(?) Suggestions\r\n* Define all code attached to `THING`s as named functions in a separate file. These should be easier to generate code that can be reread. Will need to make sure that separate file of script functions is read upon load at the appropriate time.\r\n* Only write `(MAKE-whatever ... )` code for game objects not defined in the world definition file(s) (that is, ones that have been generated while the game is running). Have the world definition file(s) read on each load, but then have all `LOCATION`s cleared and have appropriate `(BULK-ADD ... )`s in the save file. This will solve the problem of scripts added to objects in the world definition file(s), but not for those attached to objects generated while the game is running. Perhaps just disallow scripted objects to be generated? Perhaps only allow named functions (defined in the world definition file(s)) to be added to run-generated objects?"}}