Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Topics - PaulineV

#1
Hi !
I was wondering if there is any simple way (existing module or simple code) to add a 4-verbs-like system into a BASS template.
What I would like is to create a GUI with 4 icons/GuiButton (for 4 actions) : done
I would like that GUI to open when player clicks on an object and, according to the GUIbutton selected, run a specific action.

The 4 Verbs template was not the best option because I want this to happen only in specific conditions.

Thank you very much in advance !
#2
Hi AGS community !

I am creating a game where a woman is looking for an important information in her flat.
In one of the room, there is a pile of papers. When the charcter interacts with it, a GUI opens. Each one of the paper is a Gui Button. My intention is that the player can drag and drop the papers in order to find the good one with the correct information.

My code is mainly inspired from this post : https://www.adventuregamestudio.co.uk/forums/index.php?topic=50909.0

Here is my code, adapted :

Code: ags

bool WasDragging;
int OldMyItemX;
int OldMyItemY;
int DragOffsetX;
int DragOffsetY;

function repeatedly_execute() 
{
if (mouse.IsButtonDown(eMouseLeft)) {
        // have we pressed a button over our object?
        GUIControl *theGuiB = GUIControl.GetAtScreenXY(mouse.x, mouse.y); 
        if (!WasDragging && (theGuiB == b_Papier1 || theGuiB == b_Papier2)) {
            // just started draggin? remember where you took it
            OldMyItemX = theGuiB.X;
            OldMyItemY = theGuiB.Y;
            DragOffsetX = mouse.x - theGuiB.X; 
            DragOffsetY = mouse.y - theGuiB.Y; 
            WasDragging = true;
        }
        else if (WasDragging) {
            // mouse button still pressed? continue dragging
            theGuiB.X = mouse.x - DragOffsetX;
            theGuiB.Y = mouse.y - DragOffsetY;
        }
    } else if (WasDragging) {
        // was dragging but mouse button now released? drop it
        WasDragging = false;
    }
  }
}


I did it with only two papers for now, b_Paper1 and b_Paper2. It is working quite nicely exept from the situation where I go over a paper when I'm dragging the other one. It automatically switches to a dragging of the other paper.

If someone has an idea, it would be great !
Thanks in advance !
SMF spam blocked by CleanTalk