Illusionest.inc
Would you like to react to this message? Create an account in a few clicks or log in to continue.
Log in

I forgot my password

Navigation
 Portal
 Index
 Memberlist
 Profile
 FAQ
 Search
Who is online?
In total there is 1 user online :: 0 Registered, 0 Hidden and 1 Guest

None

[ View the whole list ]


Most users ever online was 105 on Sat Apr 10, 2021 4:09 pm
Poll
Statistics
We have 23 registered users
The newest registered user is mariwaigjka

Our users have posted a total of 303 messages in 86 subjects

The Basic GML Code

3 posters

Go down

Suggestion/idea The Basic GML Code

Post by OmegraKai Thu Jul 24, 2008 3:09 pm

Lesson 1 CH 1
the basic code is saying a message, lets begin
{
show_message('Hello World")
}

that creates a dialog message for GM to read, simple.
TIP: always put brackets above and below on some code.

Now lets try something a bit harder.

if keyboard_check(vk_right)
{
x+=3
}

Now you see that I didn't put brackets above "If" in GM if is asking a question to GM and only following what goes when the parameters are qualified, so if is asking GM if the the right arrow key is being pushed, then when the key is pressed X meaning the horizontal postion, move the player right, + means relative, and if you want to move the player left use the same code but change it a little.

if keyboard_check(vk_left)
{
x+=-3
}

You put a negative before any X type of situation, meaning to go the opposite direction of X.

That is the first chapter in the GML basic code tutorial.
OmegraKai
OmegraKai
Founder
Founder

Male Number of posts : 141
Age : 39
Mem. Points :
The Basic GML Code Left_bar_bleue95 / 10095 / 100The Basic GML Code Right_bar_bleue

Mod. Points :
The Basic GML Code Left_bar_bleue100 / 100100 / 100The Basic GML Code Right_bar_bleue

Warning Bar :
The Basic GML Code Left_bar_bleue100 / 100100 / 100The Basic GML Code Right_bar_bleue

Talk About your Self! : I am A Gamer!!
Registration date : 2008-04-06

Character sheet
Rate your Gaming ability's!:
The Basic GML Code Left_bar_bleue74/100The Basic GML Code Empty_bar_bleue  (74/100)

Back to top Go down

Suggestion/idea Re: The Basic GML Code

Post by OmegraKai Thu Jul 24, 2008 3:54 pm

CH: 2

creating objects in GML is very easy just type this.

{
instance_create(x,y,object)
}

thats the simplest of all code actually.

Now lets make a harder one, lets say we wanted to create a object every 20 seconds. follow these steps

CREATE
alarm[0] = 20

ALARM 0
{
instance_create(x,y,object)
}

now every 20 seconds a instance is created. Now lets try repeating instances

repeat(10)
{
instance_create(x,y,object)
}

this way you have more control of how many you want.

that concludes our Chapter for today.
OmegraKai
OmegraKai
Founder
Founder

Male Number of posts : 141
Age : 39
Mem. Points :
The Basic GML Code Left_bar_bleue95 / 10095 / 100The Basic GML Code Right_bar_bleue

Mod. Points :
The Basic GML Code Left_bar_bleue100 / 100100 / 100The Basic GML Code Right_bar_bleue

Warning Bar :
The Basic GML Code Left_bar_bleue100 / 100100 / 100The Basic GML Code Right_bar_bleue

Talk About your Self! : I am A Gamer!!
Registration date : 2008-04-06

Character sheet
Rate your Gaming ability's!:
The Basic GML Code Left_bar_bleue74/100The Basic GML Code Empty_bar_bleue  (74/100)

Back to top Go down

Suggestion/idea Re: The Basic GML Code

Post by AracnoX Thu Jul 24, 2008 10:23 pm

Thank you for that, I didn't know any code until this...
AracnoX
AracnoX
Moderator
Moderator

Male Number of posts : 46
Age : 28
Location : Wherever I feel like being.
Mem. Points :
The Basic GML Code Left_bar_bleue20 / 10020 / 100The Basic GML Code Right_bar_bleue

Mod. Points :
The Basic GML Code Left_bar_bleue0 / 1000 / 100The Basic GML Code Right_bar_bleue

Warning Bar :
The Basic GML Code Left_bar_bleue100 / 100100 / 100The Basic GML Code Right_bar_bleue

Talk About your Self! : Why do you want to hear this go away!
Registration date : 2008-07-15

Character sheet
Rate your Gaming ability's!:
The Basic GML Code Left_bar_bleue0/0The Basic GML Code Empty_bar_bleue  (0/0)

http://aracnox.wordpress.com

Back to top Go down

Suggestion/idea Re: The Basic GML Code

Post by OmegraKai Fri Jul 25, 2008 4:59 am

Smile I'm glad I helped once I fully know code I make a whole thing about it.
OmegraKai
OmegraKai
Founder
Founder

Male Number of posts : 141
Age : 39
Mem. Points :
The Basic GML Code Left_bar_bleue95 / 10095 / 100The Basic GML Code Right_bar_bleue

Mod. Points :
The Basic GML Code Left_bar_bleue100 / 100100 / 100The Basic GML Code Right_bar_bleue

Warning Bar :
The Basic GML Code Left_bar_bleue100 / 100100 / 100The Basic GML Code Right_bar_bleue

Talk About your Self! : I am A Gamer!!
Registration date : 2008-04-06

Character sheet
Rate your Gaming ability's!:
The Basic GML Code Left_bar_bleue74/100The Basic GML Code Empty_bar_bleue  (74/100)

Back to top Go down

Suggestion/idea Re: The Basic GML Code

Post by sebalex11 Fri Jul 25, 2008 11:03 am

yeah this is going to help me make my new upcoming game
sebalex11
sebalex11
Newbie
Newbie

Male Number of posts : 34
Age : 29
Location : someweverywherehere
Mem. Points :
The Basic GML Code Left_bar_bleue0 / 1000 / 100The Basic GML Code Right_bar_bleue

Mod. Points :
The Basic GML Code Left_bar_bleue0 / 1000 / 100The Basic GML Code Right_bar_bleue

Warning Bar :
The Basic GML Code Left_bar_bleue0 / 1000 / 100The Basic GML Code Right_bar_bleue

Talk About your Self! : i like to make games and play them
Registration date : 2008-07-17

Character sheet
Rate your Gaming ability's!:
The Basic GML Code Left_bar_bleue10/100The Basic GML Code Empty_bar_bleue  (10/100)

Back to top Go down

Suggestion/idea Re: The Basic GML Code

Post by OmegraKai Fri Jul 25, 2008 8:32 pm

CH 3
okay now were going to move to copying functions of off of D&D system. lets start with the TAB "Move"

D&D tab lesson 1
Move

The first thing you see is a red arrow direction cube, this is for moving directions, we have actually already covered this but here is a refreshment.
{
x+=3
speed = 3
}

x+= moving right, change it to x+= -3 and that we'll become moving left. change X to Y to make it up and down.
speed just means what type of speed you want to have, you don't have to do this but it controls it more.

second is a blue direction cube, this may be a little harder but here. ( I don't know if its harder, because I don't know how to do it... Smile )

next is a move towards type of function which in code is this.

{
move_towards_point(x,y,3)
}

3 means the speed that you want the object to move to the point x,y. if you want it to move to a object,
use this

{
move_towards_point(obj_player.x,obj_player.y,3)
}

Now the other two, with the red arrow pointing down and sideways, is simple.

{
hspeed
}
is horizontal speed
{
vspeed
}
is vertical speed.

as a example vspeed can be used for jumping to stop.

here.
if vspeed > 0 && !place_free(x,y+vspeed)
{
move_contact(270)
}
vspeed = 0

this means if vspeed is less than 0 and there is a SOLID at position of vertical vspeed, move towards the object at direction 270 (down) then when it touches it vspeed = 0.

that's a pretty hard code. but an example none the less. Smile

now onto gravity. this one is simple, in step events you to have gravity,
{
gravity = 0.5
gravity_direction = 270
}
meaning the gravity = 0.5 and the direction is down.

that concludes our lesson for now.
OmegraKai
OmegraKai
Founder
Founder

Male Number of posts : 141
Age : 39
Mem. Points :
The Basic GML Code Left_bar_bleue95 / 10095 / 100The Basic GML Code Right_bar_bleue

Mod. Points :
The Basic GML Code Left_bar_bleue100 / 100100 / 100The Basic GML Code Right_bar_bleue

Warning Bar :
The Basic GML Code Left_bar_bleue100 / 100100 / 100The Basic GML Code Right_bar_bleue

Talk About your Self! : I am A Gamer!!
Registration date : 2008-04-06

Character sheet
Rate your Gaming ability's!:
The Basic GML Code Left_bar_bleue74/100The Basic GML Code Empty_bar_bleue  (74/100)

Back to top Go down

Suggestion/idea Re: The Basic GML Code

Post by Sponsored content


Sponsored content


Back to top Go down

Back to top


 
Permissions in this forum:
You cannot reply to topics in this forum