Jump to content


Photo

D&d Actions And Their Code Equivalents


  • This topic is locked This topic is locked
147 replies to this topic

#1 Ablach Blackrat

Ablach Blackrat

    GMC Member

  • GMC Elder
  • 1215 posts
  • Version:GM8

Posted 20 October 2007 - 04:07 PM

I've finally gotten around to redoing the Drag and Drop to GML tutorial completely for Version 7. This tutorial will show you the Drag and Drop icons and their related GML coding.

Also included in this file is a complete listing of the Action Functions that Game Maker uses. These are the direct coding of the Drag and Drop Icons and, in some cases, may be easier to use then the related code. I should stress though that Action functions are entirely unsupported in Game Maker, both in the Game Maker Manual and in the Coding Window of the Object Properties dialogue. You can still use them, but they will not appear below. Action Functions should not really be used by beginners; they should learn the actual code. Once you have a grasp of GML, Action Functions will be helpful.

Please download all version in one file from the following link....

http://www.mediafire...a1um5u6fkc21cn8


Edited by Ablach Blackrat, 14 August 2011 - 12:27 AM.

  • 15



#2 computerwis

computerwis

    GMC Member

  • New Member
  • 201 posts

Posted 20 October 2007 - 04:33 PM

Is there going to be an html version later on?
  • 0

#3 Ablach Blackrat

Ablach Blackrat

    GMC Member

  • GMC Elder
  • 1215 posts
  • Version:GM8

Posted 20 October 2007 - 07:36 PM

Is there going to be an html version later on?

<{POST_SNAPBACK}>


The HTML version for both Ver 7 and Ver 6 have been put up. Sorry, I forgot about those.
  • 0



#4 Nijg

Nijg

    Caleb Cuzner

  • GMC Member
  • 1142 posts
  • Version:GM6

Posted 20 October 2007 - 10:19 PM

Is the version 7 one at all different than the version 6 one?
  • 0

#5 Ablach Blackrat

Ablach Blackrat

    GMC Member

  • GMC Elder
  • 1215 posts
  • Version:GM8

Posted 21 October 2007 - 06:03 PM

Is the version 7 one at all different than the version 6 one?

<{POST_SNAPBACK}>


The icon names have been changed to match Ver 7, some code has been cleaned up and improved thanks to several members, as well as the inclusion of the Action Codes.
  • 0



#6 Daniel-Dane

Daniel-Dane

    GMC Member

  • New Member
  • 3581 posts

Posted 21 October 2007 - 06:47 PM

I believe miscolouring is a low priority for you.
  • 0

#7 Ablach Blackrat

Ablach Blackrat

    GMC Member

  • GMC Elder
  • 1215 posts
  • Version:GM8

Posted 22 October 2007 - 12:40 AM

I believe miscolouring is a low priority for you.

<{POST_SNAPBACK}>


I though you were pointing out the glaring spelling error. I'll fix the colouring as well.
  • 0



#8 Daniel-Dane

Daniel-Dane

    GMC Member

  • New Member
  • 3581 posts

Posted 22 October 2007 - 11:06 AM

There was a spelling error as well? Well, if that was the case I would have made a nice, thin, red box around it. :(
  • 0

#9 xtreme0ninja

xtreme0ninja

    The Xtreme

  • New Member
  • 684 posts

Posted 23 October 2007 - 10:26 PM

spelling error? you mean where it says

they're are

which basicly means they are are? if thats not what ur talking about, im smart. if it is, im still smart. :P

Xtreme0 :D
  • 0
I just can't stick with one game long enough to finish it...

My current project is a sort of open-world Pacman RPG. I am currently working on it solo, with the suggestions of a few friends, but one of them might actually help code it (he needs to learn to use GM first though XD).

Though it seems I will not be able to work on it next week, since TERRARIA IS COMING OUT EARLY!!!! HELL YEAH!

#10 Nijg

Nijg

    Caleb Cuzner

  • GMC Member
  • 1142 posts
  • Version:GM6

Posted 25 October 2007 - 02:29 PM

I don't know if this is in the gm7 one too, but I have discovered in the gm6 one, for the 'When an object is at a position,' it is not only position_meeting, position_meeting is only if you have an actual coordinates. It would be place_meeting is you put into the dnd option: OBJ.x, OBJ.y. So it is position_meeting and place_meeting.
  • 0

#11 shane121

shane121

    GMC Member

  • New Member
  • 7 posts

Posted 27 October 2007 - 07:40 AM

what a great tutorial!!!
very helpful
two thumbs up :( :o :o


:) registered
  • 0

#12 Kobb

Kobb

    Crash Master

  • New Member
  • 91 posts

Posted 29 October 2007 - 10:43 PM

Thanks! I still find myself using the d@d icons alot, so this will help!
  • 0

#13 melon

melon

    www.kieranmillar.com

  • New Member
  • 274 posts

Posted 31 October 2007 - 11:29 AM

Those action codes are very interesting. I assume that when you make something using D&D, what actually happens when GM compiles the exe is turns each of them into their own codes and makes a script out of each object. Of course, I probably should have guessed it did that anyway, but I imagine that it would compile these codes, and so technically it would be faster in some cases to use D&D.

Am I right? I always wondered if GM compiled code that you write or if it's interpretted. I believe it's an odd mixture of both.
  • 0

#14 jabelar

jabelar

    GMC Member

  • GMC Member
  • 3003 posts

Posted 01 November 2007 - 07:09 PM

EDIT: Ignore my post. I just "discovered" that the d&d actions are really used inside a a with() statement, because they all seem to take "self", "other" or object as a parameter.

And I also see that you indeed mentioned that at the front of the document. :)

Edited by jabelar, 01 November 2007 - 11:45 PM.

  • 0

#15 Dark_Mage

Dark_Mage

    GMC Member

  • New Member
  • 54 posts

Posted 11 November 2007 - 03:07 AM

Any chance you could make it in a word document?
  • -1

#16 a2h

a2h

    GMC Member

  • New Member
  • 382 posts

Posted 13 November 2007 - 09:11 AM

Good on you for the update, I now use one less D&D (even though I mostly use code xD)

action_bounce(true,0);

And there's not much GML I have to learn left, just motion_set and all that... =P

Great tutorial, used it as a reference ever since it was just a simple pdf.

Edited by anger2headshot, 13 November 2007 - 09:12 AM.

  • 0

ion.developments does not exist, ignore my user title

#17 Ablach Blackrat

Ablach Blackrat

    GMC Member

  • GMC Elder
  • 1215 posts
  • Version:GM8

Posted 14 November 2007 - 02:30 AM

Any chance you could make it in a word document?

<{POST_SNAPBACK}>


Any reason you need it as a Word document? Anything in the PDF or HTML can be copied.
  • 0



#18 Meowgoocat

Meowgoocat

    GMC Member

  • GMC Member
  • 246 posts

Posted 01 December 2007 - 08:24 PM

Cool, it's fixed now.

Edited by Meowgoocat, 07 December 2007 - 11:21 PM.

  • 0

#19 K3fka

K3fka

    Game Designer

  • GMC Member
  • 562 posts
  • Version:GM:Studio

Posted 01 December 2007 - 09:37 PM

All the links are broken ;)
  • 0

#20 tristiano77

tristiano77

    GMC Member

  • GMC Member
  • 349 posts
  • Version:Unknown

Posted 14 December 2007 - 01:21 AM

by making a script called action_game_end() and having the contents be show_message("wo0t"); you see that when you add a game end action it must run the action_game_end() function, but if you change that script to game_end the d&d action still works therefore the function action_game_end is compiled separately from game_end
  • 0

#21 Nelson

Nelson

    GMC Member

  • New Member
  • 508 posts

Posted 29 December 2007 - 12:53 AM

The same nothing different. When is somebody going to do a Document on the Action codes. Any body can look in the help file and find this info. The actions codes are not in the help file so they are what will make this better not what people can find in the help file. Come on somebody put stuff that will actually help people
  • 0

#22 Big J

Big J

    GMC Member

  • GMC Member
  • 2853 posts
  • Version:GM8.1

Posted 29 December 2007 - 08:02 AM

I found an typo error (in the HTML version at least):

Draw Health
action_draw_health(x,y,x1,y,1,back color, bar color);

It should be something like this
action_draw_health(x1,y1,x2,y2,back color, bar color);

Also, it says the Game Maker Web site is:

http://www.gamemaker.nl/

Shouldn't it be

http://www.yoyogames.com/ ?

Edited by Big J, 29 December 2007 - 08:05 AM.

  • 0

Get your GM 8.1 Anti-Aliasing here!

2712265.png

http://www.youtube.com/SporkinatorBZ


#23 ugly_dwarf2

ugly_dwarf2

    GMC Member

  • GMC Member
  • 381 posts

Posted 02 January 2008 - 05:36 PM

Thanks. That will help me out alot. :D
  • 0
QUOTE (Mark Overmars @ Mar 3 2007, 10:16 AM) <{POST_SNAPBACK}>
Gamemaker makes games? o rlly?

QUOTE (Fredfredrickson @ mar 3 2007, 10:18 AM) <{POST_SNAPBACK}>
no wai didnt nowe!


#24 Shadow X

Shadow X

    GMC Member

  • New Member
  • 275 posts

Posted 03 January 2008 - 12:58 AM

Thank you very much, Ablach blackrat.
  • 0
I'm remaking a Japanese-only NES game. More details coming soon. Which means in a few years. Deal with it.

#25 Foxx

Foxx

    GMC Member

  • GMC Member
  • 887 posts
  • Version:GM:Studio

Posted 04 January 2008 - 11:18 AM

links are broken.... or not working?
  • 0

If I helped you why not give me a rep_up.png ya salty dawg
#Yolo #HardCoreSwag #KingOfTheElfs #Gm6Represent

It's 'Questions And Answers' Not 'Can Someone Else Do All The Hard Work For Me'


#26 awasteoflife

awasteoflife

    GMC Member

  • New Member
  • 92 posts

Posted 07 January 2008 - 05:39 PM

how do you do relative to?
  • 0

#27 rokuken

rokuken

    GMC Member

  • New Member
  • 364 posts

Posted 08 January 2008 - 10:59 PM

This is a WONDERFUL thing you did. But, can you tell me how can I get this same helpfull equivalent thingy for GM 5.2. See, I already started doing my game for like 2 years ago, so I'm not starting over again with a newer version. The game's pretty big & good & starting over again & fixing ALL the LOOONG codes, I don't think so...
  • 0

#28 OmegaZero

OmegaZero

    GMC Member

  • New Member
  • 122 posts

Posted 09 January 2008 - 01:24 AM

Very useful!

Thanks a lot! :P
  • 0

#29 Rybo5000

Rybo5000

    GMC Member

  • New Member
  • 423 posts

Posted 12 January 2008 - 02:36 PM

I don't think I've commented but I think I should, to thank you.

Since starting GML I've always found this very useful, and thanks alot.

:P,
Rybo
  • 0

#30 black ice00100

black ice00100

    GMC Member

  • New Member
  • 323 posts

Posted 02 February 2008 - 10:12 PM

The set background code never works
  • 0

#31 JDD

JDD

    GMC Member

  • New Member
  • 1 posts

Posted 19 February 2008 - 08:35 PM

I found on the html version of D&D to gml 7 main2 tab the change sprite icon is different than in the game.
  • 0

#32 kake_fisk

kake_fisk

    GMC Member

  • GMC Member
  • 2392 posts
  • Version:GM7

Posted 24 February 2008 - 01:25 PM

in the open webpage you have a spelling error.
you need to have http:// you had http//
  • 0

#33 Nelson

Nelson

    GMC Member

  • New Member
  • 508 posts

Posted 28 February 2008 - 03:05 AM

Same stuff is in the help file. I Suggest to use the actions codes for the D&D because that is what the actions codes are. You will need to do some testing and stuff but if you do then you will learn about stuff also.

Somebody ask what is faster the D&D or GML. Some say GML is Faster. some say D&D is faster some say they are the same because D&D is just GML code.

I say D&D is faster. Let me explain why. If you use theses codes that Ablach blackrat has in this tutorial. These codes are a lot longer than the codes the D&D icons uses. The D&D uses the action codes and not the codes in this tutorial or the help file.

So if you use these codes then Game Maker will take longer to go through codes that is longer than the codes that is in the D&D codes which is the Action codes. But there is no help on them so you have to work them functions out yourself. I done a few myself and they worked fine.
  • 0

#34 Big J

Big J

    GMC Member

  • GMC Member
  • 2853 posts
  • Version:GM8.1

Posted 28 February 2008 - 10:52 AM

D&D might be a little bit faster, but the speed difference is negligible.

The action_* functions are completely undocumented in the help file, so I discourage their use. However, if it helps a new user see the connection between D&D and GML, then so be it.
  • 0

Get your GM 8.1 Anti-Aliasing here!

2712265.png

http://www.youtube.com/SporkinatorBZ


#35 Nelson

Nelson

    GMC Member

  • New Member
  • 508 posts

Posted 28 February 2008 - 03:32 PM

Everybody has their opinion on this but most want to learn things and codes that will be faster in game play is what is at hand. But like you and I both said. the are not in the help file or any other file. I did a few my self and will try to work out a few more. I am slightly retarded and I worked out a few my self. So if I can do it a little then I know some that is smarter than me should be able to do them. I will try to see what I can do then maybe redo my D&D to code converter. I did a few in it already. and will try to work out a few more
  • 0

#36 kake_fisk

kake_fisk

    GMC Member

  • GMC Member
  • 2392 posts
  • Version:GM7

Posted 28 February 2008 - 03:35 PM

If you make a lib for your own use, you will learn gml and it will also be faster to just drop the code you want into the object :ph34r:
  • 0

#37 Nelson

Nelson

    GMC Member

  • New Member
  • 508 posts

Posted 28 February 2008 - 09:40 PM

still will want to use the action codes for the lib. But just the same. Most people just want to learn so the lib will be something that is worked out for them.

I will try to workout some of the codes myself and then maybe post them here or just redo my D&D to code converter.
  • 0

#38 Virus2_0

Virus2_0

    Penguin Programmer

  • New Member
  • 476 posts

Posted 05 March 2008 - 03:24 AM

spelling error? you mean where it says

they're are

which basicly means they are are? if thats not what ur talking about, im smart. if it is, im still smart. :P

Xtreme0 :unsure:

<{POST_SNAPBACK}>



Guiys thatis not speling... its grammmer. goshget it it rihgt. im perfecT.
  • 0

galex - NoD Member -TDS flashlights, Fast - Draw Regular Polygons
Recursive (adj.): see [i]recursive.
Programmer (n): An organism that turns caffeine into code.
FIGHT FOR GM FOR LINUX! PLEASE ADD THIS IF YOU WANT THE DEVELOPERS TO COMPILE A LINUX VERSION!


#39 AC-426

AC-426

    GMC Member

  • New Member
  • 400 posts

Posted 14 March 2008 - 03:37 PM

Thanks a lot, Ablach Blackrat. Your efforts are very appreciated.


The same nothing different. When is somebody going to do a Document on the Action codes. Any body can look in the help file and find this info. The actions codes are not in the help file so they are what will make this better not what people can find in the help file. Come on somebody put stuff that will actually help people

Where in the official GM7 help file do you find GML codes that are equivalent of the D&D actions?

Somebody ask what is faster the D&D or GML [...]
I say D&D is faster. Let me explain why. If you use theses codes that Ablach blackrat has in this tutorial. These codes are a lot longer than the codes the D&D icons uses. The D&D uses the action codes and not the codes in this tutorial or the help file.

So if you use these codes then Game Maker will take longer to go through codes that is longer than the codes that is in the D&D codes which is the Action codes.

Non-sense. You don't actually think that Game Maker leaves the GML code as you originally wrote it and that it keeps interpreting it each frame, do you? I haven't seen GM's source code, but I'm pretty sure the GML code is converted to something GM can read much quicker. Whether you use GML or D&D, they'll probably end up looking exactly the same.

For example:

action_move(90, 3) => [1, 90, 3];
action_move_point(10, 20, 5) => [2, 10, 20, 5];
and so on...

Lame example. But still, it would be A LOT faster than parsing strings every frame.
  • 0



·· FactionWars ·· Subspace Gaming
· ·· Blazezone···· ·· Andy E.H.
··· ·· 3D FPS········· ·· WarriorArtiste
····· ·· DOOM 2D······ ·· Potnop

#40 Nelson

Nelson

    GMC Member

  • New Member
  • 508 posts

Posted 14 March 2008 - 05:01 PM

You will need to look at the action codes and see what is shorter. Action codes can be shorter than the codes found in the help file. people can come up with argument after argument about what is faster and what is not. If a code is. It is suppose to be Drag and drop to code conversion which is wrong cause the D&D doesn't use the codes found in the help file. It uses the action codes.


Example

Create Moving'
//No equivalent, but you can use the following code.
ID = instance_create(x,y,object1);
with (ID) motion_set(direction,speed);


No equivalent. wrong the equivalent is

action_create_object_motion(Object,x,y,speed,direc
tion)

Edited by Nelson, 14 March 2008 - 05:22 PM.

  • 0

#41 Big J

Big J

    GMC Member

  • GMC Member
  • 2853 posts
  • Version:GM8.1

Posted 15 March 2008 - 11:54 PM

They are both equivalents.

This will get the job done as well:
with (instance_create(x,y,object))
    motion_set(direction,speed);

  • 0

Get your GM 8.1 Anti-Aliasing here!

2712265.png

http://www.youtube.com/SporkinatorBZ


#42 Nelson

Nelson

    GMC Member

  • New Member
  • 508 posts

Posted 16 March 2008 - 01:25 AM

Yes one is the code that is actually the drag and drop equivalent. That is the action code I have and the other is codes you can find in the help file.


The difference is one has two lines of code and one is just one line of code.




with (instance_create(x,y,object))
motion_set(direction,speed);


action_create_object_motion(Object,x,y,speed,direc
tion)
  • 0

#43 Big J

Big J

    GMC Member

  • GMC Member
  • 2853 posts
  • Version:GM8.1

Posted 16 March 2008 - 12:56 PM

I see. The number of lines doesn't really concern me too much.
  • 0

Get your GM 8.1 Anti-Aliasing here!

2712265.png

http://www.youtube.com/SporkinatorBZ


#44 Nelson

Nelson

    GMC Member

  • New Member
  • 508 posts

Posted 16 March 2008 - 07:28 PM

Me either but the subject is Drag and code and their equivalent. The equivalent of all drag and drop icons are the action codes not the codes found in the help file.

I know the whole purpose is teaching GML and the codes in the help file gives them something to look back to and learn from them. So in all learning the GML codes then these codes will teach one to use the codes in the help file but do not call them Drag and drop codes equivalent to their GML because they aren't that. If anything say they are Drag and drop to code translated to GML codes.

Or just teach them how to find the answer themself
  • 0

#45 pencillio

pencillio

    GMC Member

  • New Member
  • 955 posts

Posted 30 March 2008 - 08:18 PM

Thanks, this is really useful!
  • 0

#46 a1pha

a1pha

    GMC Member

  • New Member
  • 26 posts

Posted 15 April 2008 - 05:09 AM

Thanks, It's very helpful, especially the part about using "with"- that was stumping me.

Question- Do "events" have codes?
  • 0
Enormous (and stupid) over-sized signature removed.

If you break the signature rules again, your account will be closed.

#47 Dom83

Dom83

    GMC Member

  • GMC Member
  • 138 posts

Posted 21 April 2008 - 01:59 PM

Hi

I don't understand how to use "action_color();"

I tried several ways :

action_color(#E9CEA9);
action_color(E9CEA9);
action_color(233, 206, 169);

but I get an error. :D

Please help me.

Edited by Dom83, 21 April 2008 - 02:03 PM.

  • 0

#48 Big J

Big J

    GMC Member

  • GMC Member
  • 2853 posts
  • Version:GM8.1

Posted 22 April 2008 - 03:05 AM

Hi

I don't understand how to use "action_color();"

I tried several ways :

1. action_color(#E9CEA9);
2. action_color(E9CEA9);
3. action_color(233, 206, 169);

but I get an error. ;)

Please help me.

1. The # causes a syntax error.
2. Unknown variable E9CEA9 perhaps? Hexadecimal numbers are noted by a $ sign in GM.
3. Too many arguments.

Try this:
action_color($E9CEA9);
Isn't action_color() the exact same function as draw_set_color()? :P

Edited by Big J, 22 April 2008 - 03:07 AM.

  • 0

Get your GM 8.1 Anti-Aliasing here!

2712265.png

http://www.youtube.com/SporkinatorBZ


#49 Dom83

Dom83

    GMC Member

  • GMC Member
  • 138 posts

Posted 23 April 2008 - 02:30 PM

thanks
  • 0

#50 Hitman0769

Hitman0769

    GMC Member

  • New Member
  • 20 posts

Posted 28 May 2008 - 06:32 PM

Awesome Guide!!!
  • 0




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users