DMA Scripting Documentation in HTML

Anything to do with GTA1/GTA2 modding (tools, scripts and more).
BenMillard
Immortal
Posts: 889
Joined: 16 May 2009, 06:14
GH nick: BenMillard
Location: London, UK
Contact:

DMA Scripting Documentation in HTML

Post by BenMillard »

The official GTA2 scripting information (250kB) is now on my website in HTML. Just a draft at this stage. With nearly 300 commands it's a lot to remember! I'm going categorise to and re-arrange all the commands, too.

Your web browser is probably a more comfortable place in which to move around the document. You can bookmark individual commands...once I finish setting up those 300+ "Table of Contents" links.

Remember you can trade and edit code samples in realtime using the GTA2 Etherpad.
BenMillard
Immortal
Posts: 889
Joined: 16 May 2009, 06:14
GH nick: BenMillard
Location: London, UK
Contact:

Re: DMA Scripting Documentation in HTML

Post by BenMillard »

This document is basically working now. Table of Contents jump you to that command. You can guess the URL by adding a # character and then the command name. For example, CREATE_CAR is .../scripting#CREATE_CAR.

I corrected quite a few errors in the text and added some formatting. There's probably another month before the content is noticeably better than DMA wrote.

There's a commented-out section in the HTML near the current Table of Contents. This shows the categorisation and re-ordering I plan to do. Maybe that will be done this week.
User avatar
elypter
Immortal
Posts: 1120
Joined: 26 Dec 2009, 23:53
GH nick: elypter

Re: DMA Scripting Documentation in HTML

Post by elypter »

please tell us when you finished categorizing all commands.
yur sa'nok ngeyä
BenMillard
Immortal
Posts: 889
Joined: 16 May 2009, 06:14
GH nick: BenMillard
Location: London, UK
Contact:

Re: DMA Scripting Documentation in HTML

Post by BenMillard »

It will be quite a while away. But if people want it then I can do it instead of some other GTA2 stuff.
User avatar
elypter
Immortal
Posts: 1120
Joined: 26 Dec 2009, 23:53
GH nick: elypter

Re: DMA Scripting Documentation in HTML

Post by elypter »

a grouped list of scripting commands would be especially helpful for new modders.
for me personally it is not that important, i know most of the quirks already but noobs will easily get confused if something is not working like described in docs and if they don't know which commands are available for what purpose.
yur sa'nok ngeyä
BenMillard
Immortal
Posts: 889
Joined: 16 May 2009, 06:14
GH nick: BenMillard
Location: London, UK
Contact:

Re: DMA Scripting Documentation in HTML

Post by BenMillard »

Oh, actually the Table of Contents has been categorised for quite some time! The description of each command is still in DMA's slightly random order, though.

For now, you can do this:
  1. Click a command from the Table of Contents.
  2. Read, scroll, Copy and Paste or whatever.
  3. Click the Back button in your browser to get the Table of Contents again.
  4. Choose the next relevant command. (Or a totally different command.)
At the start of each major section, I could display the list commands in that section. So if you're working on a Kill Frenzy, it would link to BONUS and DO_BASIC_KF_TEMPLATE with a "Return to Top" link as well. (That section has a bullet list which sort of does this, but I'd copy-paste the complete list for Kill Frenzies from the current Table of Contents.)

It's a long way to scroll but means Ctrl+F takes you straight to the command. No need to use a search box or browse 20 separate pages.

Moving the commands around will be laborious but once I get into a good rhythm it'll happen fairly fast. (A couple of evenings, probably.)
User avatar
elypter
Immortal
Posts: 1120
Joined: 26 Dec 2009, 23:53
GH nick: elypter

Re: DMA Scripting Documentation in HTML

Post by elypter »

so this means that at the moment every command is in at least one category yet? that's what i wanted to know. i'm a bit confused by the "Mission Language Commands (All 298 of them!)" and by the fact that some categories are black and some blue
yur sa'nok ngeyä
BenMillard
Immortal
Posts: 889
Joined: 16 May 2009, 06:14
GH nick: BenMillard
Location: London, UK
Contact:

Re: DMA Scripting Documentation in HTML

Post by BenMillard »

Yes, each command is in one category. I think only one or two commands are in more than one category at the moment. That might increase or decrease.

The different colours are different levels in the categories. Here it is with indents, maybe I can flatten some parts. Or design better <h4> and <h5> styles.
  • GTA2 Scripting Information by DMA Design
    • Table of Contents
      • GBHscript
      • Mission Language Structures
      • Mission Language Commands (All 298 of them!)
        • Players
          • Arrows
          • Counters
          • Timers
          • Wanted Level
          • Messages
        • Objects
          • Blocks
          • Cranes
          • Doors
          • Lights
          • Sounds
          • Weapons
          • Vehicles
        • Characters
          • Checkpoints
          • Drivers & Passengers
          • Groups
          • Objectives
        • City System
        • Zones
        • Gangs
        • Respect
        • Mission System
        • Phone System
        • Kill Frenzy System
        • Savegame System
        • Thread System
      • General Concepts
      • GTA2script Overview & Example
      • Frequently Asked Questions
      • Constants
(EDIT) I've now hidden the lowest level of headings - the black ones. The first command in each list is enough to see what they will relate to. Did a bit of re-arrangement, so COUNTER is in the Mission Language Structures. The actual entry is cross-linked to the ONSCREEN_COUNTER stuff.

A lot more cross-linking could be done, just takes lots of time. It's getting there.
BenMillard
Immortal
Posts: 889
Joined: 16 May 2009, 06:14
GH nick: BenMillard
Location: London, UK
Contact:

Re: DMA Scripting Documentation in HTML

Post by BenMillard »

  • The categories are now a little different.
  • There's a bit more cross-linking.
  • A couple of categories start with a list of relevant commands.
  • Syntax has been tidied and corrected in many places - many still need work.
  • Some lists of constants have been put into HTML tables instead of ASCII grids.
The list of GTA2 slope types is now a lot nicer than the original, imho. Perhaps some map editors might use this degrees-based naming system?
User avatar
elypter
Immortal
Posts: 1120
Joined: 26 Dec 2009, 23:53
GH nick: elypter

Re: DMA Scripting Documentation in HTML

Post by elypter »

yur sa'nok ngeyä
BenMillard
Immortal
Posts: 889
Joined: 16 May 2009, 06:14
GH nick: BenMillard
Location: London, UK
Contact:

Re: DMA Scripting Documentation in HTML

Post by BenMillard »

Thanks, I've now made that correction. Kinda forgot about this project as there was almost no feedback. Am I the only one using it?
User avatar
elypter
Immortal
Posts: 1120
Joined: 26 Dec 2009, 23:53
GH nick: elypter

Re: DMA Scripting Documentation in HTML

Post by elypter »

im using it most of the time and i know of at least 1 other person but there aren't that many modders active atm, so there possibly be more in future.
yur sa'nok ngeyä
BenMillard
Immortal
Posts: 889
Joined: 16 May 2009, 06:14
GH nick: BenMillard
Location: London, UK
Contact:

Re: DMA Scripting Documentation in HTML

Post by BenMillard »

Good news, everyone! I've updated the entire collection of GTA2 modding tutorials on my website. I plan another round of updates, so they have better cross-linking to the main scripting guide.

Speaking of which, my re-formatted version of the official GTA2 scripting documentation now includes some properly ordered groups of commands at the start. That's a preview of what I want to do to the rest of the document. Just takes a lot of time. I also corrected and highlighted all the code samples in that grouped area.

A couple of commands in that document now have a "Multiplayer" sub-section in them, which explains their compatibility requirements. Eventually this could say "needs a character health check wrapper" and that could link to a common description. Such as a new tutorial which would cover all the tricks we know to write multiplayer-safe code.

Work is ongoing. Hopefully people are finding it useful, or will do next time they want to code something. I'm using it whenever I write code these days...'dogfooding' you might say!
Last edited by BenMillard on 08 Apr 2012, 01:17, edited 1 time in total.
User avatar
Pyro
Immortal
Posts: 414
Joined: 17 Mar 2010, 04:07
GH nick: Pyro
Location: Wales, UK

Re: DMA Scripting Documentation in HTML

Post by Pyro »

BenMillard wrote:Good news, everybody!
Every time you say that I always think Professor Farnsworth from Futurama: :P

On a more serious note however, not sure what's new on some of the tutorial pages but then again I've not had to refer to them in quite a long time. Did notice, for example, that you haven't yet updated some of the code examples like my Remote Control example and my new Basic Phone example which could be useful to others (after all, I did mention in my phone tutorial to look up answering phones in the guide :shock: not helpful!).

Speaking of which, I keep meaning to update some of my tutorials and possibly do some new ones. The script guide is still a good reference and I look it up for some commands and syntax for others, but actual relevant tutorials on specific things are good. Might make a new thread for you to look at and copy in time, will see how it goes. 8-)

Keep up the good fight!
BenMillard
Immortal
Posts: 889
Joined: 16 May 2009, 06:14
GH nick: BenMillard
Location: London, UK
Contact:

Re: DMA Scripting Documentation in HTML

Post by BenMillard »

Ah yes, forgot about your updated content! Will merge that into them during the next round of updates.

It's a deliberate Futurama reference; glad it is noticed. :-)
BenMillard
Immortal
Posts: 889
Joined: 16 May 2009, 06:14
GH nick: BenMillard
Location: London, UK
Contact:

Many small updates

Post by BenMillard »

Have made a few updates, not yet folded Pyro's stuff in though. These are based on stuff I've needed to use recently and realised wasn't properly described:
  • Working Trains Example:
    Added complete name table for zone names based on a railway with 2 stations. Also did this for a 2-railway system, each with 2 stations.
  • Scripting Guide:
    Lots of changes!
    1. Firstly, a note about CHECK_CHARACTER_HEALTH for multiplayer support.
    2. Filled in and highlighted the MAP_ZONE examples.
    3. For the first time I've used WARP_FROM_CAR_TO_POINT so I updated that - hope to write a tutorial about forcing respawns for certain teams and chapters in a level.
    4. Lists of Constants are now near the top of the Table of Contents and have shorter link text. I've removed the actual lists which are already provided in Pyro's specific tutorials.
    5. General corrections, more highlighting and standardised some more phrases.
  • Gangs in GTA2 Multiplayer:
    Updated and matched this information with the main scripting guide. Now it explains how to make gangs without arrows, too.
  • Complete list of Weapons:
    Icons are now centred in their column. Removed all MOVING_COLLECT_* entries as nobody uses them.
So inspired about GTA2 again; funny how it just takes 1 idea to work out well and everything starts falling into place. <3
BenMillard
Immortal
Posts: 889
Joined: 16 May 2009, 06:14
GH nick: BenMillard
Location: London, UK
Contact:

Re: DMA Scripting Documentation in HTML

Post by BenMillard »

A bit more neatening up and a new section about EXEC blocks. Haven't tested them myself, though.

A long time after Pyro suggested it, the tutorials are now arranged into sections.
CarThief
Hitman
Hitman
Posts: 108
Joined: 19 May 2012, 18:12
GH nick: CarThief
Location: Holland, AKA The Netherlands

Re: DMA Scripting Documentation in HTML

Post by CarThief »

Well i suppose Elypter suggested i post about this here.
It would seem the FOLLOW_CAR_ON_FOOT_WITH_OFFSET command is rather poorly documented in the official and this online version doesnt seem to have improved much on how to use it. So perhaps a improved explanation on that command, most notably that it needs 2 extra commands after the target, first being rotation and the latter being distance.

I stored this on some random mis file back in the day so i might be a bit off with the accuracy of the instructions:

Code: Select all

SET_CHAR_OBJECTIVE ( character , FOLLOW_CAR_ON_FOOT_WITH_OFFSET , car , rotation , distance )

character       - Name of the character to follow the car.
car                - Name of the car to follow.
FOLLOW_CAR_ON_FOOT_WITH_OFFSET - Command used with SET_CHAR_OBJECTIVE.
rotation - Decides on what side the ped will walk. Common values would be: 0(down), 90(right), 180(up), and 270(left).
distance - How far the ped will be from the centre of the car. Usefull/reasonable distances are 0.50 (for small cars), 0.75 (for average cars) and 1.0 (for big cars?).
Note: Depending what direction you do, higher/lower distances may be more usefull. Especially with cars like Limo's.
BenMillard
Immortal
Posts: 889
Joined: 16 May 2009, 06:14
GH nick: BenMillard
Location: London, UK
Contact:

Re: DMA Scripting Documentation in HTML

Post by BenMillard »

Thanks for the information! I've updated the guide and made it so you can link directly to FOLLOW_CAR_ON_FOOT_WITH_OFFSET instructions.

I've brought the change over to Character AI tutorial as well.

While I was working on the main document, I linked up the other Objective Types. For example, GUARD_AREA and DESTROY_OBJECT.

So much more tidying up and correcting to do with it. It's getting better every time, little by little.
JG
Car Jacker
Car Jacker
Posts: 22
Joined: 25 Jun 2011, 12:52

Re: DMA Scripting Documentation in HTML

Post by JG »

You're doing a great job with this Ben, much easier to use than the original DMA document. One thing though, have you considered increasing the amount of whitespace that follows the parameters for each command to make things a bit more readable?
Post Reply