Promiment Studios

A forum for my team

Ok, I have decided to make a point system. The more points you have the more your appreciated and trusted.1-5 points I can trust you a little. very little aprreciation5-10 pointsI can trust more than usual. regular appreciation (credits)10-15 pointsI can trust you highly. Moderator20+CO-LEADER

    creating variables


    Posts : 23
    Join date : 2009-04-13

    creating variables Empty creating variables

    Post  Tacopie981--Admin on Mon Apr 20, 2009 3:12 pm

    What is a variable? Variables are data structures that can hold one piece of data while your game is running. They can hold either a number or a string. Custom variables are variables made by you or whoever.

    There are two kinds of user variables

    Global variables that exist across the entire game

    Local variables which are defined in objects and only exist in-game within specific instances.

    Creating them

    There are many ways to create a variable. One is to use D&D by which you use the set variable buttion in the control tab.
    Another way is to use GML(coding).


    If you want to know more PM me!

    Variables can be up to 64 characters long im pretty sure. They can begin with a letter/number/underscore.

    Decrementing variables is to subtract one from a variable.


    chocolate -=1


    chocolate = chocolate - 1


    Incrementing is to add 1 to a variable.


    chocolate +=1

    _______________________ I prefer the first way tongue

    chocolate = chocolate + 1


    This means you want a variable that only can have a value from 1 to 100. And it wraps it's value from 100 to 1.

    if ( chocolate > 100 )
    then chocolate = 1

    if (chocolate < 1 )
    then chocolate = 100


    You can draw the value of a variable using GML(coding) function draw_text() or the Draw Variable action.

    Any questions PM me....

      Current date/time is Thu May 23, 2019 5:19 pm