Aller au contenu

Photo

Nwscript.nss Marked up for Doxygen


  • Veuillez vous connecter pour répondre
4 réponses à ce sujet

#1
painofdungeoneternal

painofdungeoneternal
  • Members
  • 1 799 messages
This is the game core scripts, with markup for Doxygen document generation. You can use these to generate your own doxygen references similar to the CSL library. You will note that every time a game engine function is used, it makes a link to it which shows exact information, and you can search for engine functions, or browse the files involved. ( The pages are rather large so you have to wait until they load. )

Things this can be used for
  • CSL library documentation as shown, which many are already using as a handy reference when coding.
  • Improving your documentation on your own projects by adding a detailed nwscript reference to it which includes links and information on where each function is used.
  • Searchable document you leave open in your code editor, so you can lookup functions quickly without leaving the current application.
  • Generating your own CHM files ( microsoft help viewer files ) or websites
  • Use doxygen to generate XML files which can be processed by custom tools, toolset plugins, or whatever else you can think of.
  • Really need a way to make such information show up while coding in the toolet. I actually started the doxygen based on grinning fool requesting such a resource soas to improve features in 1.24 which never materialized.

(These SHOULD not be used when compiling scripts or in the override folder as they are in a different order, and the game engine requires that nwscript.nss be as provided. These are just for generating documentation and using them to compile code will not work. )

Nwscript Constants
Nwscript Functions

Now this markup is not yet posted on the CSL documentation site, this is the source file for generating such documentation.

Now a while back the lexicon for NWN2 shutdown, which removed a valuable resource to the community. I have used what i could find on google cache for it and recovered much, and added in many examples, notes and comments formerly found on that site. Mainly because i could not live without it. As i added them to mine, i also corrected what i noticed, and since i use the actual function prototypes found in 1.23 it should be far more accurate. But i keep adjusting this, and i got some more clean up work to do. ( There is a lot of functions there )

I'd appreciate it if those who are interested could review this file and send me edits and changes as they notice issues in it. Even a cursory review pointing out misnomers and things you found helpful, example code and the like would be helpful. Having it worded better for novice scripters, and having more detailed references on gotchas and tips helps everyone making things for nwn2.

Modifié par painofdungeoneternal, 28 décembre 2011 - 09:17 .


#2
MasterChanger

MasterChanger
  • Members
  • 686 messages
Hi Pain,

Thanks for getting Doxygen documentation back up! Could you explain whether and how this is different from the documentation you had up previously?

I'd also really love to see whether it could work to add tags to functions to make them more easily searchable. As I've said previously, it seems that you need to enter the beginning of the function name to find it. Since many function names take unusual forms, I for one often end up thinking of a word in the middle of a name rather than the beginning.

At any rate, very useful work!

#3
painofdungeoneternal

painofdungeoneternal
  • Members
  • 1 799 messages
Lol, it was never down, my ip address changes ( my ISP is evil ). I added a button to Never Launcher that looks up my PW's IP address, and then opens the correct URL to show the documentation.

I updated to the latest doxygen, and had a fix to the previous I added myself so it did not search on just the prefix. ( changed the PHP coding it was using to work as I wanted ). When i get a chance i will rework it so it's got better search. Each function has it's own member page now as well ( was a bit hard to load them ) and seems like a much slicker interface.

As for what is changed, well it's got 6 months more of edits by me ( i edit it whenever i use those functions based on things i notice or want to remember - i can't remember anything so if it's not there i probably don't know about it anymore ), so its pretty much had edits everywhere.

And i went and looked up in googles cache all the function which used to be on the lexicon for NWN2. I did adjust a lot of those as the lexicon seemed like it was aimed at NWN1, but there are hundreds of functions, and only a portion i've really gotten complete. But i tried to undo the loss of that much needed site. ( we still have the NWN1 version, but we really need NWN2 specific info )

Oh and its got the latest ( some of it unreleased CSL library ) i am currently editing. But for the most part it's bug fixes which would not affect documentation. Its really a living breathing entity which is always changing and updated.

Now i know not everything in it is perfect, i keep finding things which need improvement, and my expertise is limited to areas i am focused on, this really could use broader input to make it as useful as the lexicon was.

Note you can take those files along with whatever else code you happen to be using, aim doxygen at them, and make your own documentation and save it in html, php, chm, pdf, plain text, and also use the raw xml data to send it where-ever else you'd like it. Very easy to do, the hard work is the custom tags which I use, but you can generate documentation like that without any comments. Nice thing about sharing the source files is you are not reliant upon me.

I personally keep nwscript_i open at all times, search it with my text editor as needed, and as i use it, make any corrections i notice. If you do any significant coding, having your own doxygen site would allow you to review how the code is organized, see conflicts, include diagrams and see how functions relate to each other.

Modifié par painofdungeoneternal, 29 décembre 2011 - 11:45 .


#4
MasterChanger

MasterChanger
  • Members
  • 686 messages
I just noticed another new benefit of this (possibly related to just using the new Doxygen). When looking at a script, any function that is referenced is hyperlinked to its definition. Not only that, but hovering over it will display a tooltip of its description! It makes reading a script much easier. :happy:

#5
SkywingvL

SkywingvL
  • Members
  • 351 messages
If you write your scripts in C# using the latest NWScript Accelerator plugin version (NWNX4), you'll get all the nicities of real Intellisense.