Jump to content


leihaht

Member Since 24 Jun 2012
Offline Last Active Sep 26 2012 04:14 PM

Topics I've Started

instance_activate problem

21 July 2012 - 09:52 PM

I've been having this problem several times before.
I just wonder if anyone of you can see what causes to me.
First of all, I'm using GM:S. so, it might be the GM:S problem. But not sure.

I've set 2 different rooms.
room0 and room1

there is 3 objects. all of them set persistent on.
one of object is controller, which create object2 at the room0.

object1 is able to move by keyboard.

Once object1 moves out of room0, room changes to room1.
object1 moves along because persistent set on.
object1 has Intersect Boundary event as below:
if (room == room0)
{
    x = 20;
    instance_deactivate_object(object2);
    room_goto(room1);
}
else if (room == room1)
{
    x = 610;
    room_goto(room0);
    instance_activate_object(object2);
}

which means object1 deactivate object2 before move to room1.

Here is the problem.
Whenever object1 moves out of room1, object2 should be activate, right?
However, object2 isn't displaying at all.

Any idea why this is happening?

Problem on room setting script

05 July 2012 - 02:07 AM

Hello guys.
I have very simple code here.
It looks like there is no problem.
But, this actually not working in mine.

I have created sprite and object assigning that sprite.
And controller object.
both objects are on the room.

What I am trying to do here is, control room width, height, and view setting on the code.

there is no other code but these. (oh, actually, move code on the object. so that it can move)

These code is on the controller object of Creation Event.
room_set_width(room0, 2000);
room_set_height(room0, 1000);

room_set_view(room0, 0, true, 0, 0, 640, 222, 0, 0, 640, 222, 200, 200, -1, -1, object1);
room_set_view_enabled(room0,true);

This should work, shouldn't it?

storing multiple values in the array at once

03 July 2012 - 06:30 PM

I'm trying to store multiple values in the array or data structure if possible.

This would be very easy in C++ like this.
int billy [5] = { 16, 2, 77, 40, 12071 };

However, I realized that this can't be happening in GML.
Or, I just don't know much about GML, yet.

So, is there any way I can put these multiple values just like the code in C++ above, instead of doing one by one?

font_add_sprite issue

28 June 2012 - 03:11 PM

Since I need the custom font, my game require to use font_add_sprite or something like that.

However, I've been having font issue since the beginning.

So, let me explain this issue below.

On the controller object, in Create Event
global.myfont = font_add_sprite(spr_font, 32, 0, 0);

Draw Event to display font
draw_set_font(global.myfont);
draw_set_color(c_black);
draw_text(100, 100, "Testing");

Running game shows nothing.
I believe there is nothing wrong with code.
But please tell me if there is any.

I'm using GM:S and know that there WAS font_add_sprite bug before.
But it should be fixed now.
Still, I have no idea why the code above doesn't work.

Oh by the way,
I changed code font_add_sprite to font_replace_sprite
But, it just is showing original font text, but not the sprite font.

Color Blend in 16 color game

24 June 2012 - 03:18 PM

Hello, I'm new here.

Currently I'm developing old style game.
It is 16 color games.

Because of this, I got some special issue I can't solve.

When I try to use blend to apply Night mode that affect all color including sprite, background, and gui(which is in Draw GUI event),
simply one color is too dark.

So I'm looking for some kind of way to solve this.
applying all color except one color remains.

Is this possible?

For example,
A color should be remain is RGB (109, 77, 0).
Everything else should darker using subtract blend mode.