Author Topic: Documentation improvements  (Read 3681 times)

0 Members and 1 Guest are viewing this topic.

Offline WMCoolmon

  • Purveyor of space crack
  • 213
Documentation improvements
What could be improved upon with the current set of documentation?

Right now there are three principal types; lua-only documentation on other sites, documentation on FS2_Open's implementation of the Lua language, and the scripting,html file generated by the executable. Obviously there isn't much can be done about the former without petitioning those sites' owners, but the latter two are more or less completely changeable.
-C

 

Offline Nuke

  • Ka-Boom!
  • 212
  • Mutants Worship Me
Re: Documentation improvements
well im thinking up a couple tutorials, one for drawing complex graphics procedurally, another for dealing with multiple resolutions. which will really just be a break down of code ive already written. 

there are a few discriptiones for functions in scripting.html that need improvement, like i havent a clue how gr.drawCurve() works. sometimes you get a cryptic argument that leaves you scratching your head, like Direction of gr.drawCurve() . this has us playing with the function learning how it works. and this can be a distraction. every time i need to use a new function i end up spending an hour learning what that function does (all while forgetting how my code works :D).

anyway the forum itself right now is very usefull, its full of code they can look at and learn from. and its all current system code. i think scripting should get a bigger section in the wiki as well. as it stands its written out like a table example and burried benreath a few layers. keep the table discription in tables, but then have a whole other section for actual code tutorials, examples, coding practices (how to keep neat code for example) and so on.

i guess the real way to get people into scripting is to keep giving them cool stuff based in scripting to look at. get a few modders to go hey this looks pretty straight forward and in no time at all they will have it mastered.
I can no longer sit back and allow communist infiltration, communist indoctrination, communist subversion, and the international communist conspiracy to sap and impurify all of our precious bodily fluids.

Nuke's Scripting SVN

 

Offline Wanderer

  • Wiki Warrior
  • 211
  • Mostly harmless
Re: Documentation improvements
Good tutorials/guides for properly using different 'standard' Hooks with explanations when scripts in the respective hooks are are run etc.

And the same for the conditional hooks as well.
Do not meddle in the affairs of coders for they are soggy and hard to light

 

Offline Nuke

  • Ka-Boom!
  • 212
  • Mutants Worship Me
Re: Documentation improvements
i learned quake c (long after quake was dead) merely by the hundreds of thousands of tutorials and examples on the subject. its just a matter of taking the time to create them.
I can no longer sit back and allow communist infiltration, communist indoctrination, communist subversion, and the international communist conspiracy to sap and impurify all of our precious bodily fluids.

Nuke's Scripting SVN

 

Offline WMCoolmon

  • Purveyor of space crack
  • 213
Re: Documentation improvements
http://www.hard-light.net/wiki/index.php/Scripting.tbl

Oh and I made some minor changes to the code to go along with the documentation (fixed a small bug, changed the order of collision variables to make them accessible to the overrides, changed the order of the global/on frame hooks, and added warpin variables). For the most part the documentation should work with any recent builds. It should all work with future builds.
« Last Edit: February 19, 2007, 01:59:45 am by WMCoolmon »
-C

 

Offline Nuke

  • Ka-Boom!
  • 212
  • Mutants Worship Me
Re: Documentation improvements
sticky my oo tutorial as well. im currently thinking up a new one on string manipulation. i want to do several, but if noone reads them its not much point.
I can no longer sit back and allow communist infiltration, communist indoctrination, communist subversion, and the international communist conspiracy to sap and impurify all of our precious bodily fluids.

Nuke's Scripting SVN

 

Offline WMCoolmon

  • Purveyor of space crack
  • 213
Re: Documentation improvements
*stickies both*

If you want people to read them, you should probably post a news article once you have a few done. Preferably, once there's enough of them for someone to start from knowing nothing about scripting, to doing useful/fun stuff.
-C

 

Offline WMCoolmon

  • Purveyor of space crack
  • 213
Re: Documentation improvements
Updated the backend page. I used a Tutorial->Example format this time.
-C

 

Offline Wanderer

  • Wiki Warrior
  • 211
  • Mostly harmless
Re: Documentation improvements
As you asked for feedback.. The new scripting.tbl wiki page is a lot more informative than the earlier one. And the added info about different hooks is extremely valuable. And then the scripting API page.. though not so valuable to me (as i aint a coder), the fact that it has useful info on how the scripting actually works under the hood is a very good thing.
Do not meddle in the affairs of coders for they are soggy and hard to light

 

Offline WMCoolmon

  • Purveyor of space crack
  • 213
Re: Documentation improvements
Thank you. :) Is there anything I could add to the scripting.tbl page?
-C

 

Offline Roanoke

  • 210
Re: Documentation improvements
Soz to bump an old thread but what basis does one need to learn scripting ? Or rather, where should some one look ? Posting examples is cool 'n' everything but (to use an anology) posting pictures of cool models does nothing to show how one arrives at said mesh in a 3d proggy.

 

Offline WMCoolmon

  • Purveyor of space crack
  • 213
Re: Documentation improvements
Have you gone through the (meager) stuff in this thread? http://www.hard-light.net/forums/index.php/topic,45554.0.html
-C

 

Offline Roanoke

  • 210
Re: Documentation improvements
Yeah. Most of it assumes a certain knowledge of coding. Of which I have none.

 

Offline Wanderer

  • Wiki Warrior
  • 211
  • Mostly harmless
Re: Documentation improvements
Well... my background before i started scripting was the simple use of Basic (not visual) for writing some minor things ten or so years ago.
Do not meddle in the affairs of coders for they are soggy and hard to light

 

Offline Nuke

  • Ka-Boom!
  • 212
  • Mutants Worship Me
Re: Documentation improvements
it will be alot easyer to pick up if you understand some lua. theres the lua user's wiki, which should help you understand the language itself. theres a console based lua interpreter which is good to help you better understand the syntax of the language which you can get here. once you understand the language then picking up the freespace implementation should be a bit more straight forward.

once you have a base understanding of lua, go through the scripting.html file and see what functions are available to you. once you start playing around with stuff youl catch on quick. you will want to keep up with the latest head builds of course.

debugging can be a *****. the main reason being you have to load the engine every time you want to test something. for that reason i recommend a clean mod directory with little or no mod material, and no media vps (it will reduce the loading times). retail data also assures the most stable scripting environment. i usually use release builds for testing, they are abit faster. im not sure if debug builds have an advantage when debugging script. they might but youl have to ask wmc.

some hooks run every frame, others at a specific time, like on init. the init hook is the place to define functions. you could write a function to draw a crosshair for example, and call it in hud as many times as you want. when dealing with objects, be sure to use .isValid() to see if the object is available. alot of crashes are caused by trying to access objects that dont exist (like if you try to change beta 2's velocity before it jumps in during a mission). so you can use isValid with an if statement. anyway familiarize yourself with lua first because it really comes in handy when you got a problem.
I can no longer sit back and allow communist infiltration, communist indoctrination, communist subversion, and the international communist conspiracy to sap and impurify all of our precious bodily fluids.

Nuke's Scripting SVN

 

Offline Wanderer

  • Wiki Warrior
  • 211
  • Mostly harmless
Re: Documentation improvements
Debugging builds allow you to use ba.warning("string") (pops a warning window) instead of ba.error("string") which stops the game.. which is handy for checking the functionality of control structures (for and if and the like statements).

And as always when developing something run the game in window mode.
Do not meddle in the affairs of coders for they are soggy and hard to light

 

Offline MetalDestroyer

  • Starwars reborn!
  • 210
Re: Documentation improvements
How about some examples and some advices about lua into video game and specially for the SCP engine ? It looks like the lua wiki seem totally basic and give only an understanding to the lua. And I don't get it when I have to do some lua for Freespace 2  :ick:
It's not I 'm not familiar with object programming.

I was playing with the first lua script for in-game menu for Freespace 2 but, well, I didn't understand the behavior of some part of the script. So, I've just copy/past the code and modify value and test it. :/ Since, I didn't try to go further ^^.

 

Offline Nuke

  • Ka-Boom!
  • 212
  • Mutants Worship Me
Re: Documentation improvements
well you have alot more resources now than i did when i was learning scripting. im sure if you really put in the effort you could figure it out.
I can no longer sit back and allow communist infiltration, communist indoctrination, communist subversion, and the international communist conspiracy to sap and impurify all of our precious bodily fluids.

Nuke's Scripting SVN