Author Topic: Homebrew scripts vs Internal Function calls  (Read 1378 times)

Legacy_acomputerdood

  • Sr. Member
  • ****
  • Posts: 378
  • Karma: +0/-0
Homebrew scripts vs Internal Function calls
« Reply #15 on: July 18, 2012, 01:34:13 pm »


               

Zarathustra217 wrote...

I think we would be better off with something more wiki-like, at least as a supplement. I've personally often found quirks and oddities I would like to have shared but didn't know where to.


well......

what would be the legal/copyright ramifications of mirroring the data?

i just did a recursive wget of the site and now have an exact mirror of all their data.  i'm sure it wouldn't be difficult to write some scripts to dump it all into a wiki.  provided doing that would be kosher.  '<img'>



EDIT:  ahhh, i now see there's a newer version on the vault.  i'm also assuming then that there's no reason why it can't be dumped into a wiki.
               
               

               


                     Modifié par acomputerdood, 18 juillet 2012 - 12:37 .
                     
                  


            

Legacy_Shadooow

  • Hero Member
  • *****
  • Posts: 7698
  • Karma: +0/-0
Homebrew scripts vs Internal Function calls
« Reply #16 on: July 18, 2012, 01:40:12 pm »


               

acomputerdood wrote...

Zarathustra217 wrote...

I think we would be better off with something more wiki-like, at least as a supplement. I've personally often found quirks and oddities I would like to have shared but didn't know where to.


well......

what would be the legal/copyright ramifications of mirroring the data?

i just did a recursive wget of the site and now have an exact mirror of all their data.  i'm sure it wouldn't be difficult to write some scripts to dump it all into a wiki.  provided doing that would be kosher.  '<img'>

speaking of The Krit's NWN Wiki, the formatting is quite bad here. The Lexicon has great search engine (functions in left menu) and nice formatting. The Krit and Whizard are adding script functions into wiki but its weird. The NWN Wiki doesnt seems to me a good placec for this.

Since Ive helped 1.69 lexicon team, I know that to make a html page is quite easy. Not sure how to compile windows help page but thats not needed - only thing what we need is an access to the lexicon website. Then it will be easy to change/update things.
               
               

               
            

Legacy_acomputerdood

  • Sr. Member
  • ****
  • Posts: 378
  • Karma: +0/-0
Homebrew scripts vs Internal Function calls
« Reply #17 on: July 18, 2012, 07:48:00 pm »


               i've put some effort into this, and have started importing the lexicon pages into a wiki:

http://www.dalakora....pecial:AllPages

i'm not 100% happy with the formatting - i used html2wiki (a perl module) to do the translations.  i've done some scripting to clean up the pages some, but i think it needs more.

ideally, some of the links need to be fixed up.  anyway, just a first cut.


PS:  oh, and don't get ambitious and try to update any of the pages.  i'll likely blow the entire thing away once i'm done mucking with the formatting.
               
               

               


                     Modifié par acomputerdood, 18 juillet 2012 - 06:48 .
                     
                  


            

Legacy_acomputerdood

  • Sr. Member
  • ****
  • Posts: 378
  • Karma: +0/-0
Homebrew scripts vs Internal Function calls
« Reply #18 on: July 19, 2012, 11:17:40 am »


               i'm uploading my fixed up pages right now, and i think they look pretty good!  there's some work to be done editing the sidebar and stuff to make it look more friendly, but the wiki page content itself is good.  any commments?

i realize now i should probably post in the actual lexicon thread and stop hijacking this one.
               
               

               
            

Legacy_Shadooow

  • Hero Member
  • *****
  • Posts: 7698
  • Karma: +0/-0
Homebrew scripts vs Internal Function calls
« Reply #19 on: July 19, 2012, 11:55:59 am »


               sorry but this is even worse solution that writing this into The Krit's NWN wiki

formatting is terrible, searching functions too and website adress is uknown - i mean the current scripters all know lexicon and nwn wiki, unless they dont stop by here they never find out that the lexicon is further updated

we dont need a "wiki" engine actually - we can discuss the knowledge and remarks about functions on these forums, as long as every contributor write others what he changed, there won't be any issues
               
               

               


                     Modifié par ShaDoOoW, 19 juillet 2012 - 10:57 .
                     
                  


            

Legacy_Failed.Bard

  • Hero Member
  • *****
  • Posts: 1409
  • Karma: +0/-0
Homebrew scripts vs Internal Function calls
« Reply #20 on: July 19, 2012, 01:21:48 pm »


               With the way the Bioware search function works, the key to storing it here would be in ensuring that any topics on specific functions have that function name in the thread title.  Barring a new moderator getting appointed so we could get a thread stickied for it, that is.
               
               

               
            

Legacy_acomputerdood

  • Sr. Member
  • ****
  • Posts: 378
  • Karma: +0/-0
Homebrew scripts vs Internal Function calls
« Reply #21 on: July 19, 2012, 06:00:36 pm »


               

ShaDoOoW wrote...

formatting is terrible


article formatting?  i'm still working on fixing them up, but i don't think it's THAT bad.  certainly not "terrible".  take a look at:

http://www.dalakora....stSpellAtObject

to me it looks quite similar to the lexicon itself.

i'm assuming you're referring to the wiki formatting, which i'm still working on.  the wiki categories don't work, but the "categories" section from the lexicon are still quite functional.  it shouldn't be difficult to parse those out and wiki-ize them correctly.

i did a little work setting up subcategories and you can see the beginnings of them listed in tree view on the left panel.  there's no reason why that effort can't be finished so that it mimics the lexicon.


searching functions too


searching works much better now that i finished renaming the function pages to the actual functions and not the original filenames.  still have many other categories to go, but once that's completed and all the junk is blown away i think it should work just fine.

and website adress is uknown


well of course it is!  i just set the page up this morning.  i don't own the DNS records for the lexicon so there's no way i can make it better known.  if something actually took off here we could consider an url that makes sense, but for my testing and proof of concept purposes, there's nothing wrong with my link.


i mean the current scripters all know lexicon and nwn wiki, unless they dont stop by here they never find out that the lexicon is further updated


this isn't a problem i'm trying to solve.  people were griping that the lexicon wasn't being updated, and a wiki is a perfect solution for that.

we dont need a "wiki" engine actually - we can discuss the knowledge and remarks about functions on these forums, as long as every contributor write others what he changed, there won't be any issues


i think the forums are a horrendous place to expect developers to wade through to find all the updates to the lexicon.  even with the stickied thread, it just doesn't scale.

if the lexicon were originally a wiki, then this entire issue wouldn't even exist.
               
               

               
            

Legacy_Shadooow

  • Hero Member
  • *****
  • Posts: 7698
  • Karma: +0/-0
Homebrew scripts vs Internal Function calls
« Reply #22 on: July 19, 2012, 06:22:45 pm »


               

acomputerdood wrote...

we dont need a "wiki" engine actually - we can discuss the knowledge and remarks about functions on these forums, as long as every contributor write others what he changed, there won't be any issues


i think the forums are a horrendous place to expect developers to wade through to find all the updates to the lexicon.  even with the stickied thread, it just doesn't scale.

if the lexicon were originally a wiki, then this entire issue wouldn't even exist.

you misunderstood me. Point is that using the wiki engine is needless - we can simply copy the lexicon pages to new site. 

Then few editors could do it using this forum for discussion and notification. Using project forums for example.

Althought best would be to gain access to current site ftp so we would not have to redirect scripters to new site. Do we know that the current lexicon site is abadoned and lost? If not there is no point of mirroring this away yet, first lets make some errands to contact site admin/owners.
               
               

               


                     Modifié par ShaDoOoW, 19 juillet 2012 - 05:33 .
                     
                  


            

Legacy_acomputerdood

  • Sr. Member
  • ****
  • Posts: 378
  • Karma: +0/-0
Homebrew scripts vs Internal Function calls
« Reply #23 on: July 19, 2012, 07:06:11 pm »


               here's my wget mirror of the lexicon:

http://www.dalakora....nwnlexicon.com/

but i've seen conflicting reports of how up to date it is.  people here say it's only 1.68, but on the vault page for 1.69 it says that the lexicon was updated to include its changes.

for good measure, i broke out the vault's offline version for 1.69 back into html and uploaded it here as well:

http://www.dalakora....on-1.69/output/


and yes, you're right that the simplest would be to re-host the lexicon (or get access to the old) and have some admins in charge of updating it.  that just opens the possibility of running into the same situation we have here.

anyway, i don't know how abandoned it is.  all i've seen are posts claiming the owner isn't responding.  don't know if anybody has checked the whois records to attempt contacting the person who owns the dns records or whatever.
               
               

               
            

Legacy_Shadooow

  • Hero Member
  • *****
  • Posts: 7698
  • Karma: +0/-0
Homebrew scripts vs Internal Function calls
« Reply #24 on: July 20, 2012, 07:06:43 am »


               

acomputerdood wrote...

and yes, you're right that the
simplest would be to re-host the lexicon (or get access to the old) and
have some admins in charge of updating it.  that just opens the
possibility of running into the same situation we have here.

this can happen that way or another - the site is yours, if you left the community and stop paying the site - we are all screwed again, until then as long as you give ftp access to the part of your web with lexicon to the well known scripters who ask you we are fine.

In this regards, the lexicon would be more safe under neverwinter.info website I think as its paid in advance by the NWN community, The Amethyst Dragon, do you read this? Could you mirror the lexicon there?

acomputerdood wrote...

anyway, i don't know how abandoned it is.  all i've seen are posts claiming the owner isn't responding.  don't know if anybody has checked the whois records to attempt contacting the person who owns the dns records or whatever.

yes ive heard the same but thought maybe the situation changed throrough the time, as the website is still there... But since the lexicon is not updated to 1.69 I guess the situation is still the same.
               
               

               
            

Legacy_virusman

  • Sr. Member
  • ****
  • Posts: 448
  • Karma: +0/-0
Homebrew scripts vs Internal Function calls
« Reply #25 on: July 20, 2012, 09:48:31 am »


               I just looked at GNOBT code for a moment (without thoroughly studying it) and it seems that it makes a list of objects every time you call this function.
GOBT uses global hash table for tags, which must be incredibly fast.
               
               

               
            

Legacy_acomputerdood

  • Sr. Member
  • ****
  • Posts: 378
  • Karma: +0/-0
Homebrew scripts vs Internal Function calls
« Reply #26 on: July 20, 2012, 11:23:39 am »


               

ShaDoOoW wrote...

yes ive heard the same but thought maybe the situation changed throrough the time, as the website is still there... But since the lexicon is not updated to 1.69 I guess the situation is still the same.


i have a hunch that virusman is trying to prod this thread back on topic, so i think we should shift our debate over to the lexicon thread.
               
               

               


                     Modifié par acomputerdood, 20 juillet 2012 - 10:23 .
                     
                  


            

Legacy_Zarathustra217

  • Sr. Member
  • ****
  • Posts: 322
  • Karma: +0/-0
Homebrew scripts vs Internal Function calls
« Reply #27 on: July 21, 2012, 12:26:30 pm »


               

virusman wrote...

I just looked at GNOBT code for a moment (without thoroughly studying it) and it seems that it makes a list of objects every time you call this function.
GOBT uses global hash table for tags, which must be incredibly fast.


Actually, that isn't all too surprising. Trying to rewrite the GNOBT function in NWscript, I realised that it got a bit more complicated when you wanted to find second or third nearest. I think you'd still be able to rewrite it a lot faster using GOBT, just need to think of the best way to do it.
               
               

               
            

Legacy_Failed.Bard

  • Hero Member
  • *****
  • Posts: 1409
  • Karma: +0/-0
Homebrew scripts vs Internal Function calls
« Reply #28 on: July 21, 2012, 01:02:50 pm »


               You'd have to set up a pretty big struct to simulate a psudo array to have any chance of doing it on a larger scale, I think.  It'd take quite a few instructions having to bump the more distant results back each time as you compare, though.

 To be honest, I've never seen a need for getting anything beyond the second closest target by tag.
               
               

               
            

Legacy_Zarathustra217

  • Sr. Member
  • ****
  • Posts: 322
  • Karma: +0/-0
Homebrew scripts vs Internal Function calls
« Reply #29 on: July 21, 2012, 01:04:07 pm »


               This is the best guess I have presently:

object GetNearestObjectByTag_Opt(string sTag, object oSource=OBJECT_SELF, int nNth=1)
{
    while(nNth>0)
    {
        int nCount=0;
        float fNearest=9999.0;
        float fTest=0.0;
        object oArea=GetArea (oSource);
        object oTemp;
        object oNearest=OBJECT_INVALID;
        while((oTemp=GetObjectByTag(sTag, nCount))!=OBJECT_INVALID)
        {
            if(GetArea(oTemp)==oArea&&!GetLocalInt(oTemp, "GNOBT"))
            {
                if((fTest=GetDistanceBetween(oSource, oTemp))<fNearest)
                {
                    fNearest=fTest;
                    oNearest=oTemp;
                }
            }
            nCount++;
        }
        if(oNearest==OBJECT_INVALID)
        {
            return oNearest;
        }
        else if(nNth>1)
        {
            SetLocalInt(oNearest, "GNOBT", TRUE);
            //Use AssignCommand as this makes the function run at the end of the script.
            AssignCommand(oSource, DeleteLocalInt(oNearest, "GNOBT"));
            nNth--;
        }
        else
        {
            return oNearest;
        }

    }
    return OBJECT_INVALID;
}

Don't have chance to profile it right now but will do later. Any suggstions for a better solution though?
               
               

               


                     Modifié par Zarathustra217, 21 juillet 2012 - 12:16 .