Jump to content

GUIDE: The Basics of Scripting


robhol

Recommended Posts

I've made a "little" guide that I think will prove helpful for a lot of people.

Note: the guide is down for the time being. I'm not sure when it'll be back up, so stay tuned. Do NOT ask me for login details or nag me about the guide in any way.

http://robhol.net/guide/basics

The guide mentions the most important parts of scripting for MTA.

Thanks to arc_ and 50p for proofreading and opinions.

Edited by Guest
Link to comment
I've made a "little" guide that I think will prove helpful for a lot of people.

http://robhol.net/guide/basics

The guide mentions the most important parts of scripting for MTA.

Thanks to arc_ and 50p for proofreading and opinions.

Some links opens at the same tab/browser, add this argument in -> target="_blank"

That's actually done purposely - opening a link into a separate tab or window is something most browsers will let you do by clicking another button on your mouse, or holding down a key. This way people can open it wherever they want.

Edit: I also updated the stylesheets a little.

Link to comment

Looks very good, a few points:

Page 3

- For resources, I'd discuss how they run - how they're like programs that run independently and can communicate with events.

- 'essentialle' should be 'essentially'. I'd argue it's not required too - map files are XML files.

- I'd mention that using map files is more efficient (less data is sent to clients than with script functions).

- I'd definitely highlight the importance of map files for use with the map editor, and allowing other resources (i.e. maps) to extend a resource without writing code. It's something a lot of people don't seem to get.

Page 4:

For server/client functions I'd also emphasise that it's best to write server-side code where possible - less risk of people hacking the code and easier to avoid getting out of sync.

Page 6:

You say coronas are technically markers - they're not really. MTA just munges checkpoints, markers and coronas into one system. In GTA they're three separate systems. Doesn't really matter though...

Page 8:

You somewhat gloss over the element tree, maybe this should be expanded in more depth with some pretty pictures and some examples of how an event (on say, a vehicle) would get triggered and which elements would see it.

Event arguments - maybe make it clear that the arguments depends on the event type. Make it clear the names don't matter, just the order.

Custom events should probably mention about using events as a way of making more specific events. A flag in CTF is the example I use on the wiki, where onMarkerHit becomes onFlagPickedUp if the marker was a flag marker, and the player was on the right team (etc).

Page 11:

Mention accounts and perhaps settings as a way of storing persistent data. Also mention that resources can save map files.

I think it'd be useful for someone, whether part of this guide or not, not write a guide to how to create a new gamemode, properly handling map files etc (using getElementsByType etc), writing EDF and making it all work with the editor.

Link to comment

eAi, thanks for the input. I do wish, however, that you'd take it over PM instead of here.

I updated chapters 3 and 4. I decided to ignore chapter 6 - from a scripter's point of view they are the same and work the same way. In chapter 8 I frankly don't see how it any of it makes a big difference nor is important enough to include, at least not in a basics guide. As for chapter 11, I've had enough bad experiences with account data that I wouldn't recommend it as a way of storing data. As far as settings go, I've never really used them.

Link to comment

Not sure why you'd rather I sent you that via PM, it not exactly secret information. I agree chapter 6 makes little difference either way, I was just saying that what you've said is wrong, even if it is unimportant and could be omitted entirely.

I do think the element tree is important for people to understand, obviously it's your call!

Maybe there could be an 'advanced' guide in the future covering things like the element tree, proper game mode creation etc... :)

Definitely a good guide, I've added it to the main page of the wiki.

Edit: Stickied.

Link to comment
  • 2 weeks later...
  • 3 weeks later...
  • 1 month later...
  • 1 month later...
  • 4 weeks later...
  • 2 weeks later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...