Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting
FAQ Members List Calendar Today's Posts

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 01-29-2011, 12:17 AM
WhiteDragon WhiteDragon is offline
Banned
Join Date: Feb 2007
Posts: 1,002
WhiteDragon is a splendid one to beholdWhiteDragon is a splendid one to beholdWhiteDragon is a splendid one to beholdWhiteDragon is a splendid one to beholdWhiteDragon is a splendid one to behold
Sneak Peak: GDoc

This is something I've been planning for awhile now, and finally have been able to start in the past few days.

GDoc is an automatic documentation generator for GS2.

You plug in some GS2 code (with docs in it), and it'll dump out a formatted webpage.

Eventually, I want to make it so you can dump in your whole server and get back all your scripts documented. For now, it only works on a single script.


For example, this is the output you get:
http://althack.org/gdoc.html

From this script:
http://althack.org/source.txt


The syntax I use inside the "documentation blocks" is the same as PHPDoc and JavaDoc, so should be familiar to anyone who uses either of those languages. Whenever I finish this I'll write an article on how to write GS2 documentation.


When I extend this to support a serverfull worth of scripts, it will have navigation on the side, and scripts will be separated into npcs/weapons/classes categories.

I'd really like to have some support for showing what classes a script is joined to, but it'd be pretty annoying since it'd involve some heavy GS2 parsing. One possibility is to let the scripter write what classes are joined in comments, but I doubt that'd be updated regularly so I probably won't go that route.


The styling I'm using will likely change in the future, but if there is anything that you'd like to see changed I'm definitely interested.

The code that does this GS2->Doc translation is written in Haskell (a programming language). I'll put it on github eventually, just haven't gotten around to it.



Right now, I have plans to:
  • Support parsing an entire serverfull of scripts at once.
  • Provide a script-level doc block, so you can give information about the whole script rather than just a function. (I was currently doing it in onCreated but I'd like to separate it eventually.)
  • Update the styles some. Not sure exactly what yet.
  • (Maybe) Do something about join()s.

This post is basically a request for feedback/comments so let it rip.

Last edited by Skyld; 01-29-2011 at 12:19 AM.. Reason: Links approved by Skyld
Reply With Quote
  #2  
Old 01-29-2011, 12:34 AM
Fulg0reSama Fulg0reSama is offline
Extrinsical Anomaly
Fulg0reSama's Avatar
Join Date: Sep 2009
Location: Ohio
Posts: 3,049
Fulg0reSama has a brilliant futureFulg0reSama has a brilliant futureFulg0reSama has a brilliant futureFulg0reSama has a brilliant futureFulg0reSama has a brilliant futureFulg0reSama has a brilliant futureFulg0reSama has a brilliant futureFulg0reSama has a brilliant future
WhiteDragon is attempting to put all GS2 scripters out of business. RUN FOR THE HILLS!
__________________

Careful, thoughts and opinions here scare people.
Reply With Quote
  #3  
Old 01-29-2011, 12:36 AM
WhiteDragon WhiteDragon is offline
Banned
Join Date: Feb 2007
Posts: 1,002
WhiteDragon is a splendid one to beholdWhiteDragon is a splendid one to beholdWhiteDragon is a splendid one to beholdWhiteDragon is a splendid one to beholdWhiteDragon is a splendid one to behold
Quote:
Originally Posted by Fulg0reSama View Post
WhiteDragon is attempting to put all GS2 scripters out of business. RUN FOR THE HILLS!
Hehe. I'm actually trying to make it easier for people to become scripters by providing easy-to-read documentation!

Edit: Oh, and this may very well be part of my grand scheme to provide script packages along with docs and other resources / conquer the world.
Reply With Quote
  #4  
Old 01-29-2011, 12:40 AM
Soala Soala is offline
Ideas on Fire
Soala's Avatar
Join Date: Jun 2007
Location: In my head
Posts: 3,208
Soala is a jewel in the roughSoala is a jewel in the rough
Quote:
Originally Posted by WhiteDragon View Post
Hehe. I'm actually trying to make it easier for people to become scripters by providing easy-to-read documentation!

Edit: Oh, and this may very well be part of my grand scheme to provide script packages along with docs and other resources / conquer the world.
You only deserve +rep for attempting to help us all.
Reply With Quote
  #5  
Old 01-29-2011, 12:45 AM
Fulg0reSama Fulg0reSama is offline
Extrinsical Anomaly
Fulg0reSama's Avatar
Join Date: Sep 2009
Location: Ohio
Posts: 3,049
Fulg0reSama has a brilliant futureFulg0reSama has a brilliant futureFulg0reSama has a brilliant futureFulg0reSama has a brilliant futureFulg0reSama has a brilliant futureFulg0reSama has a brilliant futureFulg0reSama has a brilliant futureFulg0reSama has a brilliant future
Quote:
Originally Posted by WhiteDragon View Post
Hehe. I'm actually trying to make it easier for people to become scripters by providing easy-to-read documentation!

Edit: Oh, and this may very well be part of my grand scheme to provide script packages along with docs and other resources / conquer the world.
Riiiiiiiiiight (+rep btw)
__________________

Careful, thoughts and opinions here scare people.
Reply With Quote
  #6  
Old 01-29-2011, 01:00 AM
Tigairius Tigairius is offline
The Cat
Tigairius's Avatar
Join Date: Jan 2007
Location: Missouri, USA
Posts: 4,240
Tigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant future
Nice I will probably use it.
__________________


“Shoot for the moon. Even if you miss, you'll land among the stars.”
Reply With Quote
  #7  
Old 01-29-2011, 01:18 AM
cbk1994 cbk1994 is offline
the fake one
cbk1994's Avatar
Join Date: Mar 2003
Location: San Francisco
Posts: 10,718
cbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond repute
Send a message via AIM to cbk1994
Nice work. Someone should take the code you make once you've finished it and generate documentation for some commonly-used objects (TServerPlayer, GuiControl (and children), etc) and upload it somewhere. It would be a valuable resource for new scripters and experienced scripters. I might have a crack at it if no one else does.

EDIT: What are you using for syntax highlighting of the source code? I can provide you with the GeSHi rules I use on my pastebin site if that would be at all helpful to you (example) — even if you're not using GeSHi, you might find the color definitions helpful.
__________________
Reply With Quote
  #8  
Old 01-29-2011, 01:32 AM
0PiX0 0PiX0 is offline
Coder
0PiX0's Avatar
Join Date: Jan 2011
Posts: 130
0PiX0 is a jewel in the rough0PiX0 is a jewel in the rough
I often have trouble finding proper (any) documentation. I'm sure many people do. This seems like it would be very useful. Well done.
__________________
Reply With Quote
  #9  
Old 01-29-2011, 01:47 AM
WhiteDragon WhiteDragon is offline
Banned
Join Date: Feb 2007
Posts: 1,002
WhiteDragon is a splendid one to beholdWhiteDragon is a splendid one to beholdWhiteDragon is a splendid one to beholdWhiteDragon is a splendid one to beholdWhiteDragon is a splendid one to behold
Quote:
Originally Posted by cbk1994 View Post
Nice work. Someone should take the code you make once you've finished it and generate documentation for some commonly-used objects (TServerPlayer, GuiControl (and children), etc) and upload it somewhere. It would be a valuable resource for new scripters and experienced scripters. I might have a crack at it if no one else does.
Yeah, I've thought of this. My first thought was "How do you document an object anyways?", since they are created at runtime and could really be anything. I guess the smartest way to do it would be to create some classes that model the object hierarchy. I would definitely need to get some join() support working to make it as good as it should be though (e.g., generate a graph/tree of the object hierarchy).

And yeah, if you want to do something like this it'd be super cool. It'd also in general be nice to have someone making docs to see if there are any sudden feature requests and stuff. I'm hoping that I'll maybe release a version of GDoc within a couple days.

Quote:
Originally Posted by cbk1994 View Post
EDIT: What are you using for syntax highlighting of the source code? I can provide you with the GeSHi rules I use on my pastebin site if that would be at all helpful to you (example) — even if you're not using GeSHi, you might find the color definitions helpful.
Currently I'm using a Haskell library that reads kate syntax files and highlights accordingly. At the moment I'm just using the Javascript syntax file, but I will probably edit it at some point to match GS2 better.

If you want to send your file my way that'd definitely be helpful so I can see the various tokens you've defined and such.
Reply With Quote
  #10  
Old 01-29-2011, 01:51 AM
cbk1994 cbk1994 is offline
the fake one
cbk1994's Avatar
Join Date: Mar 2003
Location: San Francisco
Posts: 10,718
cbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond repute
Send a message via AIM to cbk1994
Quote:
Originally Posted by WhiteDragon View Post
Currently I'm using a Haskell library that reads kate syntax files and highlights accordingly. At the moment I'm just using the Javascript syntax file, but I will probably edit it at some point to match GS2 better.

If you want to send your file my way that'd definitely be helpful so I can see the various tokens you've defined and such.
attached
Attached Files
File Type: zip gs2.php.zip (2.3 KB, 167 views)
__________________
Reply With Quote
  #11  
Old 01-29-2011, 06:42 AM
adam adam is offline
http://wiki.graal.us/
adam's Avatar
Join Date: Nov 2001
Posts: 2,247
adam has a spectacular aura about
Send a message via AIM to adam
I can see it now, gscript site akin to github and sourceforge, and the ability to pull scripts from rc to your server from it. o.O along with documentation
__________________
Rogue Shadow (TCN)(NAT)(Global Development Team)

For development help, contact the patrons of the #graaldt irc channel below, I am usually there.
Click Here to Join IRC Chat Now! -- irc.freenode.net Channel: #graaldt
Quote:
<Dustyshouri> no, RogueShadow is always talking about scripts lol
<Dustyshouri> in fact, he pretty much brought Graal back as a topic single-handedly
Reply With Quote
  #12  
Old 01-29-2011, 06:48 AM
Fulg0reSama Fulg0reSama is offline
Extrinsical Anomaly
Fulg0reSama's Avatar
Join Date: Sep 2009
Location: Ohio
Posts: 3,049
Fulg0reSama has a brilliant futureFulg0reSama has a brilliant futureFulg0reSama has a brilliant futureFulg0reSama has a brilliant futureFulg0reSama has a brilliant futureFulg0reSama has a brilliant futureFulg0reSama has a brilliant futureFulg0reSama has a brilliant future
Quote:
Originally Posted by adam View Post
I can see it now, gscript site akin to github and sourceforge, and the ability to pull scripts from rc to your server from it. o.O along with documentation
Quote:
Originally Posted by Fulg0reSama View Post
WhiteDragon is attempting to put all GS2 scripters out of business. RUN FOR THE HILLS!
I repeat myself.
__________________

Careful, thoughts and opinions here scare people.
Reply With Quote
  #13  
Old 01-29-2011, 07:49 AM
WhiteDragon WhiteDragon is offline
Banned
Join Date: Feb 2007
Posts: 1,002
WhiteDragon is a splendid one to beholdWhiteDragon is a splendid one to beholdWhiteDragon is a splendid one to beholdWhiteDragon is a splendid one to beholdWhiteDragon is a splendid one to behold
Here is the Haskell source: https://github.com/whitedragon/gdoc. Not really useful if you don't know how to read/run Haskell code but just in case anyone does (afaik only Loriel does).

Updates this weekend probably, can just watch that repo if you are very interested.
Reply With Quote
  #14  
Old 01-29-2011, 09:46 AM
fowlplay4 fowlplay4 is offline
team canada
fowlplay4's Avatar
Join Date: Jul 2004
Location: Canada
Posts: 5,200
fowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond repute
The syntax looks mean.
__________________
Quote:
Reply With Quote
  #15  
Old 01-29-2011, 10:51 AM
Crono Crono is offline
:pluffy:
Join Date: Feb 2002
Location: Sweden
Posts: 20,000
Crono has a reputation beyond reputeCrono has a reputation beyond reputeCrono has a reputation beyond reputeCrono has a reputation beyond reputeCrono has a reputation beyond reputeCrono has a reputation beyond reputeCrono has a reputation beyond reputeCrono has a reputation beyond reputeCrono has a reputation beyond reputeCrono has a reputation beyond reputeCrono has a reputation beyond repute
+rep enjoy ur massive boost
__________________
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 10:44 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.