Coh3n
2010-12-16 19:24:49
Keep in mind that once it's setup, Anitban.simba will serve as an example for you guys to see, and we'll vote on whether or not we should keep it; although, I have a feeling we will. ;)
From: Coh3n
Okay guys, click here to see the documentation.
I'm sure you'll all agree to use it, but I just want to make sure before I start changing the script/function headers. Take a look at Antiban.simba to see what the commenting will look like. Yes, it's pretty long, but I think it's neat and it avoids us having to constantly update the Core tutorial (which isn't up to date anyway).
This documentation will be automatically updated depending on our commits. :) If you write a function header, be sure to be very descriptive and explain the parameters. You shouldn't really need it (just follow the format of what I did for Antiban.simba, but if you're wondering how to do different formats you can go here).
For functions with several parameters, I think it will be best to use a list format. I'm not positive of how to do this yet, but as soon as I am I'll post it here.
:)
Animating.simbaAntiban.simbaBanking.simbaDebug.simbaGlobals.simbaItems.simbaLocations.simbaMainloop.simbaManipulation.simbaObjects.simbaObstacles.simbaReports.simbaScripts.simbaSetup.simbaSkills.simbaTrack.simbaWalking.simbaMining.simbaWoodcutting.simbaMagic.simbaFishing.simbaCooking.simbaRunMe.simba
Here's a couple templates. You should just have to copy/paste into the include and replace the necessary information.
(*
MSI_FindRandoms
~~~~~~~~~~~~~~~
.. code-block:: pascal
procedure MSI_FindRandoms;
Checks to see if the player has encountered a random event
.. note::
| Author: Coh3n
| Last Updated: 07 December 2010 by Coh3n
Example:
.. code-block:: pascal
if (not FindObjects) then // Note that FindObjects is used only as an example
MSI_FindRandoms;
*)
For using lists (functions/procedures with several parameters):
(*
MSI_AddToProggy
~~~~~~~~~~~~~~~
.. code-block:: pascal
procedure MSI_AddToProggy(WhatToAdd, Obj, Item, Quant: Integer);
Adds variables specified by 'WhatToAdd' to the progress report. If one of the
parameters is unused (i.e. you're adding Loads, set it to -1). See
MSI_CountItems in Banking.simba for a good example of this being used.
- WhatToAdd: There are different 'PROG_' constants found in Globals.simba.
- Obj: Represents the index of the object in the player's Script array.
- Item: Represents the index of the item in the player's Script.Items array.
- Quant: The quantity you want to add.
.. note::
| Author: The MSI Team
| Last Updated: 25 November 2010 by Coh3n
Example:
.. code-block:: pascal
MSI_AddToProggy(PROG_ADD_EXP, -1, -1, 1000); // To add experience
MSI_AddToProggy(PROG_ADD_ITEMS, 0, 2, 28); // To add items
*)