Re: Scripting: Getting Started (WIP)
Agreed. The console was just about getting ones' groovy feet wet without necessarily having to pull up a big IDE. That is also the same console that I will launch "in game" in a script-developer mode when I get to that point. So some familiarity is probably a good thing.
That's a good point. Rethinking the progression it might be better to start off with notepad and some simple "copy and paste" style examples to whet the appetite. We can use them to explain some of the bigger concepts (like "event-driven", "scripting", etc.) then introduce the Groovy Console and script-builder mode (once ready) and finally recommend Java SDK/IDE etc.
I'm wondering now if the whole Java SDK/IDE thing is even necessary? I assumed it would be but if there's no real benefit to Johnny Modder then we can leave that for the advanced/die-hard modders.
There will be ways to have all of the following:
-global variables available to all scripts (only exists in a hacky way but I may decide this is too dangerous anyway)
-global variables available to a specific script (any variables defined in the script are global to the script, ie: same variable for all players)
-in-memory data associated with a player/connection (this requires more code than it should and is what I talk about above. This data only lasts while the player is logged in)
-persistent data associated with a player (in multiplayer this already exists for string, int, etc... primitive types. playerData.someValue = "foo"; playerData.save())
One I'm on the fence about:
-persistent data associated with any entity (the entity system supports this but it's not as straight forward as the playerData example above)
In Neverwinter Nights, we could have any local variable we wanted on any object. I can make some nice functions for doing this within the entity system but I have to see how well it performs. One thing you couldn't easily do in NWN was have random objects just to stick things on (well, you could but they cost you)... In Mythruna's entity system, an entity is free (literally costs nothing) until it has data associated with it.
My NWN roots make me want to say "local variables for the win" but back then (before campaign variables, NWNX and the various database add ons) that was really all we had for transferring data between scripts or making it persist. I wrote a bank system for the PW I played on at the time (just before local variables were patched in) and it used an item's tag to encode the bank balance!
I'm sure if you add "entity variables" people will find ways to use them where it makes sense to add persistent data to something other than the player, for example, I can't imagine trying to make TileMagic without them! Mmm ... BlockMagic ... that sounds like a good name for a mod ...
*wanders off thinking*