Jump to content


queviltai

Member Since 26 Dec 2008
Offline Last Active Jan 05 2013 05:06 PM

Posts I've Made

In Topic: Referring To An Object...

24 May 2010 - 08:05 AM

(sorry havn't used Game Maker for a while (i use C# and AS2). I was just passing by... so the function (instance_create) might be wrong....... =P)

Yep, instance_create() is the right function.

is it possible to refer to an object using a variable?

i.e ...

objectinmypocket = "obj_key"

(assuming the object obj_key actually exists)

...and then...

objectinmypocket.x = 100
objectinmypocket.y = 250

...etc.


Yes, this is possible, but you wouldn't use quotes around obj_key because its a real value, not a string. The name of the object is a kind of special global variable itself, so if you assign its value to some other variable it can be used the same way as you would use the object name. Aside from using it in constructions such as object.x or object.speed, you could pass the variable as an argument to a function or use it in "with" statements.

In Topic: Creating Lines To Join Objects?

23 May 2010 - 12:41 PM

just spread the love

But don't spread STI's

In Topic: Creating Lines To Join Objects?

23 May 2010 - 11:38 AM

and draw_line_width() as well

EDIT:
I'm running Ubuntu here so I don't have GM but I'll do my best. Put this in the draw event:

draw_set_color(c_yellow);
draw_line_width(object_1.x, object_1.y, object_2.x, object2.y, 5);
draw_line_width(object_1.x, object_1.y, object_3.x, object3.y, 5);
draw_line_width(object_2.x, object_2.y, object_3.x, object3.y, 5);

draw_set_color($FFFF66);
draw_triangle(object_1.x,object_1.y,object_2.x,object_2.y,ob
ject_3.x,object_3.y,0);

In Topic: Use External Files?

20 May 2010 - 08:22 AM

Haha nice headings there RocketLauncher

In Topic: Using Get Integer.

18 May 2010 - 08:13 AM

show_message requires a string as its sole argument. Use the string() function to turn the user's value into a string first.