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

Messages - Amir

#21
Quote
You write something similar in your "repeatedly_execute" function (e.g. in global script), and replace this with checking if there's a character, object, etc under the dragged item (or under the mouse x,y if you prefer), and if there's then, for example, call RunInteraction(eModeUseinv) for that object below.

Hi, I wrote something and I can now interact with hotspots,objects and characters but wrong interaction and inventory items don't interact with other inventory items. Do u know what's wrong?

Code: ags
function game_start() 
{ 

  DragDrop.Enabled = true;
  
  DragDropCommon.ModeEnabled[eDragDropInvItem] = true;
  DragDropCommon.DragMove = eDDCmnMoveGhostGUI;
  DragDropCommon.GhostGUI = gInvItemGhost;
  DragDropCommon.GhostTransparency = 0;
  DragDropCommon.GhostAlpha = false;
  DragDrop.DefaultHookKey = 0;
  DragDrop.DefaultHookMouseButton = eMouseLeft;
  DragDrop.DragMinDistance = 0;
  DragDrop.DragMinTime = 0;
  DragDrop.AutoTrackHookKey = true;
  DragDrop.DefaultUnhookAction = eDDUnhookRevert;
  }
  




Code: ags


function repeatedly_execute()
{
Character *chara = Character.GetAtScreenXY(mouse.x, mouse.y);
Object *obj = Object.GetAtScreenXY(mouse.x, mouse.y);
Hotspot *hot = Hotspot.GetAtScreenXY(mouse.x, mouse.y);
InventoryItem *inv = InventoryItem.GetAtScreenXY(mouse.x, mouse.y);

if (DragDrop.EvtWantDrop)
{
  if ((chara != null) || (obj != null) || (hot != null) || (inv !=null))
  {
   Room.ProcessClick(mouse.x, mouse.y, eModeUseinv);
  }
}
}



#22
Ahaaaa, I see.

I've tried something similar but not exactly as you described it. I will try it. Many Thanks.

QuoteI might need to add another room to this demo showing how to script this kind interaction

This is the best idea I ever heard  ;-D

QuoteI have a little game that uses this module too here: https://github.com/ericoporto/dungeonhands

I will check it out.

#23
@Crimson Wizard,  I checked room 4 script and created a gui like in ur module and I could drag the inventory items, but I couldn't let them interact with other inventory items, hotspots, objects and characters.

@eri0o  Oh, that's right. I'm trying to change a few things in my game so that it can be played on Android devices. All that remains is to drag the inventory items like other AGS games on Android, Whispers of a Machine, Blackwell series, etc.

if you are sure eri0o that this this module doesnt work on Android, is there some other code or method anywhere to do that?
#24
Can u drop and drag inventory items with the module and let them interact with other inventory items, hotspots, objects and characters?

I tried but I couldn't get it. Codes or modules for drop and drag of inventory items in other threads would also help although I couldn't find any.
SMF spam blocked by CleanTalk