1. Hello Guest! It's with a heavy heart that we must announce the removal of the Legacy GMC Archive. If you wish to save anything from it, now's the time! Please see this topic for more information.
    Dismiss Notice

OFFICIAL Tutorial Guidelines and Template

Discussion in 'Tutorials' started by Nocturne, Apr 16, 2016.

  1. Nocturne

    Nocturne Friendly Tyrant Forum Staff Admin

    Joined:
    Apr 13, 2016
    Posts:
    7,046
    Here you can post tutorials that you have written or recorded for everyone in the community to learn from. All tutorials must be free and threads posted should follow the template given below. Code should use semicolon line termination and appropriate indentation. And it should have sufficient explanatory comments. This improves code readability and promotes good coding practice. Check this pinned topic below for some examples.

    This forum is moderated, meaning that after posting your thread it will not be visible until a moderator approves it. Threads that do not use the provided template, or use poor coding practices, or that the staff find inappropriate or of little use will be removed and an alert sent to the user to inform them.

    Below is the Thread template that must be used when creating a new thread. It is designed to make it easier for both users and staff to see what the tutorial is about and give easy and immediate access to links and downloads:


    TOPIC TEMPLATE

    GM Version: <Version Of GM used to make the tutorial>
    Target Platform: <Target platform/s (iOS, Android, etc...) for the tutorial. Use ALL for general tutorials>
    Download: <Direct link to the download or the Marketplace. Use N/A if there is no download>
    Links: <Additional links for videos or extra information. Use N/A if not applicable>

    Summary:
    <A brief one or two line summary describing the tutorial>

    Tutorial:
    <The main body of the tutorial. If the tutorial is a video then it should go here, embedded using the Media button in the editor or the bbcode [MEDIA=youtube]oHg5SJYRHA0[/MEDIA]>


    GM Version: GM7
    Target Platform: All
    Download: http://www.host-a.net/u/Mark13673/ObjectCreating.gmk
    Links: Original Topic

    Summary:
    This tutorial is basically an RTS building example aimed at teaching you how to use Parents, create buttons, use global variables, and permit user interaction.

    Tutorial:
    The example itself should be good for beginners in GML as I have taken the time to comment every single bit of code so that at all times you can open an object and see exactly what it does, what it's for and how it does what it has to do. So if you are just starting in GML then this may be a bit complex but with a bit of reading of the manual and a bit of practice I'm sure that you will get it!

    In this example I have made three button objects that, when pressed, create a mask object. This object uses the sprite of the instance to be created (given to it by the button object) for collision checking so that the player can see precisely where he can and cannot place the selected building. In the above screenshot, you can see that the mask object on the left is red to indicate that the building cannot be put there. This is because by giving the mask object the sprite of the object that we wish to create, we can then do precise collision checks using that sprite and have image_blend change the colour of the sprite if there is a collision.

    559f[1].png

    The buttons themselves are three different objects, but they share a common parent. What is a parent? Well, it is a special object that...

    <SNIP - further tutorial text...>

    So that's it! A simple example but with lots of juicy details that I hope helps everyone who downloads!

    General forum rules and guidelines apply too.
     
    Last edited: Apr 17, 2016
    Morne, Bentley, Sysop and 2 others like this.
  2. Abrexas

    Abrexas Member

    Joined:
    Aug 10, 2016
    Posts:
    78
    A video tutorial of mine was removed because I did not terminate my lines of code with a semicolon. I don't understand the issue with that, but I'm happy to make the correction.

    Would it be possible for you to update the template/guideline to mention this detail? As GML does not require semicolons, it was a big surprise to see my post be taken down for this reason and I think it would be nice for others to know ahead of time.

    Thanks,
    - Steven French
     
    chance likes this.
  3. chance

    chance predictably random Forum Staff Moderator

    Joined:
    Apr 22, 2016
    Posts:
    802
    As we discussed by PM, you changed your project file to include semi-colon line termination, so I approved your post. Thanks for the fast response.

    And your suggestion about more explicit guidelines is a good one. I'll discuss this with Nocturne.

    EDIT: The guidelines have been updated.
     
    Last edited: Apr 13, 2018
    Abrexas likes this.

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice