Right, that's smart 
I leave the topic opened, maybe someone will have some coding solution too.

I leave the topic opened, maybe someone will have some coding solution too.
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 MenuQuote from: VampireWombat on Wed 22/05/2019 13:18:19
You're welcome and good luck. My coding is probably bad enough to make a programmer cry. But it should accomplish what you seem to want.
Edit: I just remembered why I always had to click the object a second time. To be able to only click it once and then click the verb using this method would require putting the object code under the Verb buttons in the Global Script.
Here's a revised version. It only uses one Int variable, ObjectNumber. The downside to it is that it does the same thing to any object in any room with the number...
function oTV_Interact()
{
gVerbs.X = mouse.x;
gVerbs.Y = mouse.y;
gVerbs.Visible=true;
object_selected= "TV";
}
Quote from: Crimson Wizard on Tue 21/05/2019 21:40:27Quote from: PaulineV on Tue 21/05/2019 13:10:52
When I tried the Drag and Drop module, I used room objects so I thought I was in the situation "moves the actual object on screen at real-time" so I didn't need the GhostGUI.
Apparently I did not understand quite well this module, I am very new to AGS coding and this seems huge !
There are 3 modes:
- move object itself
- move its image on GUI
- move its image on Overlay
DragDropCommon.DragMove property sets current mode.
But it is still possible that the module has mistake, or documentation is not clear enough. So please tell whether you managed to use it in the end.
Quote from: VampireWombat on Wed 22/05/2019 13:02:44
Oops. I meant click on the object again. And actually, that part can be bypassed by using another string variable.
I'm sure there's a way to simplify things using structs or creating a new function or something, but I haven't gotten into those yet.
The Global String Variables are Action, Action2, and ObjectName.
Here's sample code for the display GUI. You could use the default one and just change the name.
Quote from: VampireWombat on Wed 22/05/2019 00:14:26
I've done this before, actually. The problem is that the method I used meant having to click on the object to make the GUI appear, click on the action, and then click on the action again.
The GUI was positioned based on where the mouse was when clicked and used a String variable.
I'm sure there's a cleaner way to do it. But if you still want to do it built on the BASS system, I can provide some sample code.
Quote from: morganw on Wed 22/05/2019 00:29:32
There is a replacement for the current VerbCoin template that sounds a little like what you are asking for. I don't think many people have tried it, but you can download it from here if you want to give it a try. Maybe it will just be useful as an example of a context-sensitive GUI that pops-up, but the inventory system is pretty much the BASS one and I tried to keep it as simple as I could.
There also some basic instructions for it in the new manual:
https://adventuregamestudio.github.io/ags-manual/TemplateVerbcoin.html
Disclaimer: both of these items are effectively pre-release
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;
}
}
}
By continuing to use this site you agree to the use of cookies. Please visit this page to see exactly how we use these.
Page created in 0.084 seconds with 13 queries.