Jump to content


Photo

D&d Actions And Their Code Equivalents


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

#41 Big J

Big J

    GMC Member

  • GMC Member
  • 2825 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

#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
  • 2825 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

#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

#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
  • 2825 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

#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

#51 Green_Sky

Green_Sky

    GMC Member

  • New Member
  • 70 posts

Posted 03 June 2008 - 09:17 PM

with create moving you can use with (instance_create(x,y,object1) ) motion_set(direction,speed); because instance_create returns the id of the new object
  • 0

#52 goreforcexgames

goreforcexgames

    GMC Member

  • New Member
  • 594 posts

Posted 08 June 2008 - 03:25 AM

oh this is great, it helps me out a lot! :P
  • 0

#53 bobo7264

bobo7264

    GMC Member

  • New Member
  • 30 posts

Posted 23 June 2008 - 03:50 PM

1)

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. dry.gif

Please help me.


Doesn't gm prefer c_<color> to col,orc,ode or C070UR?

2) What's the GML for relative? I.E if object exists at -32,32 relative.
  • 0

#54 Dangerous_Dave

Dangerous_Dave

    GMC Member

  • Global Moderators
  • 9282 posts
  • Version:Unknown

Posted 24 June 2008 - 01:58 AM

1. I don't know what this guide teaches, but I disaprove of anything starting with action_*. draw_set_color(c_red) will set the drawing colour to red, however I'm not entirely sure what action_color(...) is actually supposed to do.
2. If object exists at x-32, y+32
  • 0

#55 GrayAvocado

GrayAvocado

    A big bad Wolf

  • GMC Member
  • 1226 posts

Posted 25 June 2008 - 12:59 PM

1)

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. dry.gif

Please help me.


Doesn't gm prefer c_<color> to col,orc,ode or C070UR?

2) What's the GML for relative? I.E if object exists at -32,32 relative.

make_color_rgb?


x-32, y+32

Edited by -wolfprograming-, 25 June 2008 - 12:59 PM.

  • 0

#56 Littlefire

Littlefire

    GMC Member

  • New Member
  • 22 posts

Posted 17 July 2008 - 04:55 AM

thank you thank you thank you thank you thank you!!!!!!!!!!!! :huh: :) ::lmao::
  • 0

#57 bobo7264

bobo7264

    GMC Member

  • New Member
  • 30 posts

Posted 21 July 2008 - 06:14 PM

What is not?
For example,

[codebox]if variable =0 NOT{
score += 10000000000000000000000000000000000000000000000000
}[/codebox]

Edited by bobo7264, 21 July 2008 - 06:14 PM.

  • 0

#58 Dangerous_Dave

Dangerous_Dave

    GMC Member

  • Global Moderators
  • 9282 posts
  • Version:Unknown

Posted 22 July 2008 - 05:09 AM

not is the logical negator. It makes true false and false true. So, your example corrected:
if not (variable == 0)
{
  score += 10000000000000000000000000000000000000000000000000
;
}

That code will add 1000000...0000000 to the score if the variable "variable" is not equal to 0.
  • 0

#59 Rexhunter99

Rexhunter99

    GMC Member

  • GMC Member
  • 922 posts

Posted 29 July 2008 - 08:08 AM

not is the logical negator. It makes true false and false true. So, your example corrected:

if not (variable == 0)
{
  score += 10000000000000000000000000000000000000000000000000
;
}

Not true, Not is a name for !, basically, Not checks to see if the variable is equal to the value if it isnt (doesnt matter what it is) then the following code will execute.
  • 0

#60 pokeboy

pokeboy

    GMC Member

  • New Member
  • 1 posts

Posted 29 July 2008 - 12:45 PM

I cant get it to work :D :)
  • 0




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users