I
id07
Guest
So I'm trying make a basic RPG room for testing.
And I wanted to have a virtual mouse click/button (for android) that when colliding with an the object (NPC) , that upon clicking the visible virtual key/a button (mouse left click) in the room, the collision would check that the left button is pressed and in the NPC object, will do things, like dialogue
So I have 3 objects that I want to use
the NPC
the player
the virtual A button (left mouse pressed)
In the NPC object -
I have it set up with
a collision event with the player obj
and have this code:
Code is set to "a_button_active_obj" and not self
-----------------------------
if instance_exists(a_button_active_obj)
{
if mouse_check_button_pressed(mb_left)
{
show_message("Hello!");
}
}
--------------------------------------------
In the player object there is nothing.
Nothing in the A button object
I have set up arrows that represent movement as a virtual d-pad on screen and are set to "left button pressed" (depending on the direction) for continuous movement when holding down the virtual key.
Now when the player does collide with the object, because the virtual d-pad uses the mouse click, once I collide with the NPC, if the virtual key is not pressed, but rather clicked next to the object, it brings up the hello message. But, I'd like a virtual button (an A button) to trigger the dialogue instead of using the d-pad, which the A button doesnt work at all. SO it all works, kinda, but I want to use the virtual a button as a trigger.
Any suggestions or advice how to better achieve this? Thanks in advance!
And I wanted to have a virtual mouse click/button (for android) that when colliding with an the object (NPC) , that upon clicking the visible virtual key/a button (mouse left click) in the room, the collision would check that the left button is pressed and in the NPC object, will do things, like dialogue
So I have 3 objects that I want to use
the NPC
the player
the virtual A button (left mouse pressed)
In the NPC object -
I have it set up with
a collision event with the player obj
and have this code:
Code is set to "a_button_active_obj" and not self
-----------------------------
if instance_exists(a_button_active_obj)
{
if mouse_check_button_pressed(mb_left)
{
show_message("Hello!");
}
}
--------------------------------------------
In the player object there is nothing.
Nothing in the A button object
I have set up arrows that represent movement as a virtual d-pad on screen and are set to "left button pressed" (depending on the direction) for continuous movement when holding down the virtual key.
Now when the player does collide with the object, because the virtual d-pad uses the mouse click, once I collide with the NPC, if the virtual key is not pressed, but rather clicked next to the object, it brings up the hello message. But, I'd like a virtual button (an A button) to trigger the dialogue instead of using the d-pad, which the A button doesnt work at all. SO it all works, kinda, but I want to use the virtual a button as a trigger.
Any suggestions or advice how to better achieve this? Thanks in advance!