Author Topic: dood's scripts and stuff  (Read 797 times)

Legacy_acomputerdood

  • Sr. Member
  • ****
  • Posts: 378
  • Karma: +0/-0
dood's scripts and stuff
« on: June 20, 2012, 01:03:50 am »


                just wanted to re-post some of my nwvault submissions here to get some feedback on them.  i think they're pretty well described on the vault pages, but they're all implemented in my PW (www.dalakora.com:5121) if you want the check them out live.  in no particular order:

NWNX web spawner - my system that uses exported minimaps to spawn creatures, placeable, and items in the game from a handy cgi webpage.

NWNX web-to-game chat - a cgi chat page that allows web users to chat with players in the game.

PW map with google's API - an overland map of my PW (and instructions on how to make your own) using google maps' API.

NWNX storyteller with web submission - a simple cgi submission page for users to submit fanfiction to the database and a creature that will re-tell the stories to PCs in the game.

NWN player status page - my first foray into NWNX database and web page integration.  a simple status system to see who's logged in the game.

game log to forum posting - my perl scripts i use to parse the game's log file looking for specific entries.  the code then auto-posts to a phpBB forum automatically using curl.
               
               

               


                     Modifié par acomputerdood, 24 juin 2012 - 03:06 .
                     
                  


            

Legacy_Carcerian

  • Hero Member
  • *****
  • Posts: 1655
  • Karma: +0/-0
dood's scripts and stuff
« Reply #1 on: June 20, 2012, 01:46:32 am »


               Interesting stuff!

Does web chat have the potential for language translation?
               
               

               
            

Legacy_acomputerdood

  • Sr. Member
  • ****
  • Posts: 378
  • Karma: +0/-0
dood's scripts and stuff
« Reply #2 on: June 20, 2012, 01:56:38 am »


               

Carcerian wrote...

Interesting stuff!

Does web chat have the potential for language translation?


wow, ummmm...  never thought of that.  i'm trying to use chrome's "right click -> translate to english" and it seems to be hanging.  i also tried translate.google.com, and it kind of worked but choked after i entered my chat name.

i have a feeling that neither one of those are going to work.


though the code is modular enough that you could shim in a function to translate the text that's pulled from the database before it's presented to the web client.  you could also translate text submitted from the web client before it's entered in the db, too.  that's assuming, of course, that such a module/API/whatever exists.

of course it would only work for translating text on the web end.  i'd shudder to think of using nwscript to do any translations.  but it's feasible to translate all web text into the language of your server to display in game.  all you'd need on the cgi page is a "select your language" radio button when you log in.
               
               

               
            

Legacy_Carcerian

  • Hero Member
  • *****
  • Posts: 1655
  • Karma: +0/-0
dood's scripts and stuff
« Reply #3 on: June 20, 2012, 03:07:08 am »


               Yeah, I'd think making nwn do it all on its own would def be a performance hit for sure, but how about making an
external chat client do all the work and just echo the end result? Perhaps IRC or the like?

I know people who speak english as a second language (or not at all) would definatly have use for a "babel" system.

Ingame seamless onchat translation channeling to and from web would be most preffered obviously, tho even a simple web page as suggested would be an massive improvement for players (as you can paste translated text to nwn, but copying nwn text is sadly not an option...)

I'm suprised nobody has ever proposed web translation, it was my first thought upon seeing  your nwn-web work:)
               
               

               


                     Modifié par Carcerian, 20 juin 2012 - 03:10 .
                     
                  


            

Legacy_Carcerian

  • Hero Member
  • *****
  • Posts: 1655
  • Karma: +0/-0
dood's scripts and stuff
« Reply #4 on: June 20, 2012, 04:02:13 am »


               *Random acts of voting* '<img'>
               
               

               


                     Modifié par Carcerian, 20 juin 2012 - 03:13 .
                     
                  


            

Legacy_nwnsmith

  • Full Member
  • ***
  • Posts: 125
  • Karma: +0/-0
dood's scripts and stuff
« Reply #5 on: June 20, 2012, 05:09:40 am »


               Interesting body of work. I am light on the php side but I will try and implement these over the next week or two.
               
               

               
            

Legacy_acomputerdood

  • Sr. Member
  • ****
  • Posts: 378
  • Karma: +0/-0
dood's scripts and stuff
« Reply #6 on: June 20, 2012, 11:13:12 am »


               

nwnsmith wrote...

Interesting body of work. I am light on the php side but I will try and implement these over the next week or two.


let me know if you need any help!
               
               

               
            

Legacy_acomputerdood

  • Sr. Member
  • ****
  • Posts: 378
  • Karma: +0/-0
dood's scripts and stuff
« Reply #7 on: June 20, 2012, 11:29:23 am »


               

Carcerian wrote...

I know people who speak english as a second language (or not at all) would definatly have use for a "babel" system.


the web does not fail - there is a perl module to use google's babelfish to translate text:
http://search.cpan.o...16/Babelfish.pm

i would suggest keeping the database (that nwn reads) in the language of the server (to save you from translating in the game).  then you can just shim in the $obj->translate call each time you read from or write to the database from the web client(s).

as i mentioned earlier, just have some radio buttons on the login page to select the language you want.


and now that i'm thinking about it, i wonder if there's a way to translate text in the game using the nwnx chat plugin.  hmmmm......

if the chat plugin can enter each text spoken into the db, then you can set up a mysql trigger to fire on INSERT (http://forums.mysql....7815#msg-257815) which can call a perl (or whatever) script to translate it to whatever language you want and insert it back in the db.  your original chat plugin script should then have a delayed read (1 second?) to read the newly translated text back out of the db and speak it to the specific players.

sounds a little crazy, but it might just work!  all chats would be delayed 1 second (maybe more, maybe less) but it should be doable with a bit of hard work.
               
               

               
            

Legacy_WebShaman

  • Hero Member
  • *****
  • Posts: 1390
  • Karma: +0/-0
dood's scripts and stuff
« Reply #8 on: June 21, 2012, 02:37:30 pm »


               I really, REALLY like your work here!

Thanks for posting it!

This is really awesome sauce!  I expect that it is also accessable due to the website via Smartphone, right?
               
               

               
            

Legacy_Rolo Kipp

  • Hero Member
  • *****
  • Posts: 4349
  • Karma: +0/-0
dood's scripts and stuff
« Reply #9 on: June 21, 2012, 02:41:44 pm »


               <mapping his...>

Oh! My! I completely missed the mapping tute! I *really* like!

Thank you for posting this, ACD.

If there are other under-appreciated contributors out there <and we know there are>
*please* promote your stuff like this. Data-mining the vault is problematical at best, while scanning the forums for new posts is part of my morning wake-up =)

<...ikkle head off ;-)>
               
               

               
            

Legacy_acomputerdood

  • Sr. Member
  • ****
  • Posts: 378
  • Karma: +0/-0
dood's scripts and stuff
« Reply #10 on: June 21, 2012, 03:04:00 pm »


               

WebShaman wrote...

This is really awesome sauce!  I expect that it is also accessable due to the website via Smartphone, right?



everything is written in perl/cgi with maybe a bit of javascript (i'm a little old-skool), so i see no reason why a smartphone couldn't handle it.

the webspawner, of course might be difficult because you have to click on the right spot on the maps.  that would depend on your screen size, how much you could zoom, and a stylus would probably help.

i see no reason why the webchat wouldn't work, though.
               
               

               


                     Modifié par acomputerdood, 21 juin 2012 - 02:04 .
                     
                  


            

Legacy_Rolo Kipp

  • Hero Member
  • *****
  • Posts: 4349
  • Karma: +0/-0
dood's scripts and stuff
« Reply #11 on: June 21, 2012, 03:18:55 pm »


               <donning his lenses...>

Do you think google's map API might be compatible with Zoomify?

If so, both your web spawner and your PW maps would get a huge bump in detail :-)
Edit: Imagine screenshots of the areas in full detail stitched together for that area map... ;-)

<...*and* the magnifying glass>
               
               

               


                     Modifié par Rolo Kipp, 21 juin 2012 - 02:19 .
                     
                  


            

Legacy_acomputerdood

  • Sr. Member
  • ****
  • Posts: 378
  • Karma: +0/-0
dood's scripts and stuff
« Reply #12 on: June 21, 2012, 03:40:55 pm »


               

Rolo Kipp wrote...

Do you think google's map API might be compatible with Zoomify?


i don't see much difference in zoomify's images vs. google maps.  they both seem to produce a similar effect (zoomable image/map).  the downside is that zoomify expects you to pay them something.

also, i didn't immediately seem evidence of being able to place map markers in it like i do in my google maps.

finally, i prefer the open standard because i'm a tinkerer.

If so, both your web spawner and your PW maps would get a huge bump in detail :-)
Edit: Imagine screenshots of the areas in full detail stitched together for that area map... ;-)


i'm not catching the connections you're making here.  zoomify and google maps seem to be doing the same thing.  they both take a bunch of little maps stitched together into one giant one and then cut them up (tile them) into smaller and smaller pieces.

neither one "creates" detail when it zooms in.  to get more detail in my maps, i'd need to start with something better than the mini-map exporter tool.  i KNOW it would be possible to somehow extract the map from the module that you see in the toolset.  i've not seen anybody attempt that, and i'm not desperate enough yet to try myself.

unfortunately for screenshots, they won't give you the overhead view of the areas (assuming you mean screenshots from the game).  i suppose i could screenshot each area in the toolset, though.  still it's not something i think is worth the effort.

what would be cool, though, would be to have screenshots from the toon's view in the game - this could give you the "street view" effect which would be absolutely amazing!  but again, creating a bot/google car to walk around the module taking screenshots and recording coordinates is a little beyond my abilities.
               
               

               
            

Legacy_acomputerdood

  • Sr. Member
  • ****
  • Posts: 378
  • Karma: +0/-0
dood's scripts and stuff
« Reply #13 on: June 21, 2012, 03:47:07 pm »


               

acomputerdood wrote...

the web does not fail - there is a perl module to use google's babelfish to translate text:
http://search.cpan.o...16/Babelfish.pm



i started some work on this and identified the areas i'd need to add the translation function to.  it really wouldn't be that hard.  as i was coding it up, i noticed in the TOS that you're not supposed to be using scripts and stuff to use their services.

i realized i was polling the db every second to grab messages, and thought they would quickly get annoyed with me for hitting their translation page that often.  so i abandoned that effort.

there is still hope for the project though.  there are some offline translation programs that would easily provide the same results.
               
               

               
            

Legacy_Rolo Kipp

  • Hero Member
  • *****
  • Posts: 4349
  • Karma: +0/-0
dood's scripts and stuff
« Reply #14 on: June 21, 2012, 03:52:17 pm »


               <making a deal...>

acomputerdood wrote...
i don't see much difference in zoomify's images vs. google maps.  they both seem to produce a similar effect (zoomable image/map).  the downside is that zoomify expects you to pay them something.

Hmmm... the main selling point of Zoomify is to take a very high resolution image and present it at variable resolution levels. And they do have a free package... Holy moly! Zoomify express has been hidden :-P Guess they want to sell product...

Edit: Zoomify Express Map example...

also, i didn't immediately seem evidence of being able to place map markers in it like i do in my google maps.

finally, i prefer the open standard because i'm a tinkerer.

That's why I was asking if they could work together, I.e. use zoomify to deliver the image to to the map API.

i'm not catching the connections you're making here.  zoomify and google maps seem to be doing the same thing.  they both take a bunch of little maps stitched together into one giant one and then cut them up (tile them) into smaller and smaller pieces.

neither one "creates" detail when it zooms in.  to get more detail in my maps, i'd need to start with something better than the mini-map exporter tool.  i KNOW it would be possible to somehow extract the map from the module that you see in the toolset.  i've not seen anybody attempt that, and i'm not desperate enough yet to try myself.

unfortunately for screenshots, they won't give you the overhead view of the areas (assuming you mean screenshots from the game).  i suppose i could screenshot each area in the toolset, though.  still it's not something i think is worth the effort.

Does the Google Map API allow you to start with a very high resolution image and serve it out in bandwidth-friendly sections? I know their satellite images are handled this way, but can you do this with custom images? If it does, then that is the functionality I was looking for in Zoomify.

what would be cool, though, would be to have screenshots from the toon's view in the game - this could give you the "street view" effect which would be absolutely amazing!  but again, creating a bot/google car to walk around the module taking screenshots and recording coordinates is a little beyond my abilities.

Oh, yes! Or let players tag the map with screenshots from their explorations :-)

<...with the devil in the details>
               
               

               


                     Modifié par Rolo Kipp, 21 juin 2012 - 02:57 .