PA starts having more and more mods that depend on other mods. They would benefit from a real JavaScript module system (http://requirejs.org/docs/whyamd.html) for managing those dependencies. Then the right order of loading mods would happen automatically, and the mods would be better isolated. See the aforementioned link for more bemefits.
Big fan of requirejs - I'll probably use it at least during development if I make any significant mods. At the mod manager level we might need some version awareness as well.
There has been some talk from Uber about improving PA's moddability. I'm hoping that incorporating a module system could be done as part of those efforts. But it would also be worthwhile to explore modularization within the current modding system, without changes to PA.
I made a technical test and RequireJS seems to work. One particular point of curiosity was error reporting - require-loaded files will report file and line numbers, addressing a frustration I have with the builtin loading system. https://github.com/JustinLove/pa_requirejs_test (Since this is a tech test, all it does is console.log stuff.) Actually using it in the current system would need something to manage the global functions: A requirejs mod that others depended on, which would have exclusive definition of the path mappings. (I've not looked at the source to see if it would tolerate dynamic config modification) Stripping require: https://github.com/gfranko/amdclean Namespacing: http://requirejs.org/docs/faq-advanced.html#rename
ORF would be pleased to talk to you about this at some point relating to the Realm pack and dependencies...
Sorry, I never thought to watch the thread and the messages were fairly innocuous in the stream. I downloaded TeamSpeak after hearing about it so much, but don't know which servers are used. Forums would be good in case someone else wanted to chime in, not that many have.
What do you mean? Who are you looking to communicate with via Teamspeak? That would dictate which server you'd be using.
He'll be on the Realm's teamspeak - I'm on mobile ATM so can't help but hopefully if you PM him he'll give you the IP
Looks like the status for now is: There is some ambiguity about what the Realm Pack is; perhaps that needs it's own thread. I'm currently working on using RequireJS internally within Gross Economy, and then stripping it out for release. Hopefully this will provide a useful example for further discussion.
Latest version of Gross Economy has RequireJS with amdclean, all run with Grunt. If you look back in history, you could also see the state just before amdclean. https://github.com/JustinLove/gross_economy
What if you do this? require("script.js?timestamp=" + Date.now()); Wouldn't that force it to load the file even if it has a cached version?
http://stackoverflow.com/questions/8315088/prevent-requirejs-from-caching-required-scripts This is the better way to do it. Otherwise, wouldn't all users of the mod need to run coherent without the cache?
Thanks for the link, I'll look into it. It's only relevant for developers, not users. First because users won't be rapidly changing files while the game is running. Second because I'm currently stripping AMD for release.
I think I see AMD in the Galactic War stuff. Will investigate further, and see if breaks my mod version.
Blunderful - it's loaded everywhere but only configured in GW rooted in GW. Maybe that sort of works the way scenes are isolated.