so, i don't get on the DM client nearly as much as i want. i wanted a way to affect the game world remotely even if i couldn't log in.
i used the NWNX database system (i LOVE this!) to make a table of the creatures i want spawned and where to put them. each heartbeat, the module checks the spawn table and spawns the resrefs at the coordinate vectors i put in there.
i then went one step further and made a webpage that lets you type in the resref you want spawned, and then click on a map of the area. the .cgi script will then calculate the nwn vector location based off the pixel you clicked in the map and enter the spawn command into the database for you.
the code i'm uploading isn't some of my most polished work, but i wanted to upload the most "basic" version of it now because i've started making lots of module specific modifications to it.
the module modification is very simple. there's one file (aw_ws_inc) with 2 functions in it. one is to create the mysql table at each module load. the second is to run at each heartbeat.
to set up the webpage, it's quite a bit more complicated. first, you need a mysql table of all the areas in the module. i actually do this in OnModuleLoad as well. i just cycle through them at each restart and build the table.
second, you need the minimaps of each area. i used:
Link which is a somewhat clunky (but effective!) java tool to pull the minimaps from each area of the module. i don't know if there's a better way to get better resolution images.
then, of course, you need to know the resrefs of your creatures from the toolset palette. i just have a text box to type them in right now. someone tipped me off about "moneo", which uses letoscripts to do batch processing on a module. i used that to dump a list of creatures, their resrefs, CRs, and stuff. the plan is to make a selectable and searchable list on my webpage to spawn stuff instead of having to look up the names in the toolset. but then i digress into my module specific updates. you could also use these letoscripts to build the afore mentioned areas table.
oh, and of course, your module will need to work with the NWNX system and the odbc plugin.
finally, since there's SO much work to do on your part before you can actually get it working, here's a link to my module's set up:
Link
- pick one of the areas
- put in the resref of the creature you want (i've auto populated the field already)
- then click on the map
the script will then enter the spawn information into the database (actually, this one doesn't because i turned that part off for my demo here - haha). the module will then read the spawn information at the next heartbeat and create that object at the coordinates you clicked.
of course, feel free to contact me for help getting it set up if you need it.
wow, that's a lot of text.
update:
i had to add a bit of code to the game module to handle cases where items were being placed inside terrain. by default, the system was putting them at 0 on the Z axis, so stuff was ending up in mountains and things. i got a tip from the bioware forums to first create an invisible creature, find his altitude, destroy him, and THEN create the item at that altitude. now items and placeables are created where they should be.
update 2:
i guess it's a fairly complicated system to try to set up yourself. i tried to explain it well, but who knows if i was making sense. check out my "demo" website, and don't hesitate to contact me here or email or whatever. i'd be happy to help you set this up for your own servers.
update 3:
another update to fix some bugs. when i would save a custom set of spawns and then reload it later, if my list of spawns was too big, then it would cause the "too many commands at once" error and kill the script in the game. i fixed it by limiting the number to only 10 spawns per heartbeat. i think my game was handling 30, but i still went with 10 to be safe. i'm not sure if different hardware can handle more commands or not.
oh, and another problem i had is that my original type in my "savedspawns" table was a text, and i think that was too small. i made an enormous amount of spawns in one area, and i think it got cut off when i saved it. i changed that table field to a longtext. i'm sure that's big enough :D if you were using my original setup, you'll need to update your mysql table. i was actually able to mysqldump that table, drop it, recreate it, and then restore my backup and successfully saved all my data.
i don't anticipate needing to update the module anymore. the couple functions i uploaded here should be all you need.
the cgi webpage i've linked to in the description is more or less how i want it. i MAY create some sort of pin pointer overlay thing for web-created-placeables to give the webDM a little more feedback, but i need to learn that still.
the .cgi scripts included in the zip are woefully out of date. i'm not updating them, though. the ones i'm hosting are VERY module specific and wouldn't be much use to anybody else.